Player1 will be controlled by the 'W', 'A', and 'D' keys.

  • Use My Key Press to have player1 .move_up() 30 pixels when the 'W' key is pressed.
  • Use My Key Press to have player1 .move_left() 30 pixels when the 'A' key is pressed.
  • Use My Key Press to have player1 .move_right() 30 pixels when the 'D' key is pressed.

Don't forget to change the letter of the key once in the event definition and twice in the event handler.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)