We want player2 to hit the ball acrross the net when the kitten and ball collide.

  • Add Collision with Shape to your program. Change the name at the start of the event handler to player2.
  • Change the first if statement to test for colliding with "blue". Delete the second if statement and its command.
  • Change the command under the first if statement to .set_x_speed() of the hit_sprite to -4 (negative).
  • Add another command under the same if statement to .set_y_speed() of the hit_sprite to 5.

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)