STEP 5: Let's set up the stage so that the food will drop from the top and fall through the floor.

  • Go to the section of the toolkit and drag Disable Floor into the bottom of your program.
  • Then drag out Set Gravity. Change the number in .set_gravity() from 10 to 4.
  • Drag out Sprite Gravity Off. This prevents the fish from falling even though the stage's gravity is on.

When we create fish food, it will now drop automatically and fall through the floor of the stage if it's not caught!

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

stage.set_background("underwater") sprite = codesters.Sprite("fish") sprite.go_to(-100, -220)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)