STEP 2: In this game, we need objects to pass through the sides of the stage. Let's add our sprite too.

  • From , drag out Disable Walls onto the next line at the bottom of the program.
  • Go to the toolkit and drag Dinosaur onto the next line in the program.
  • Click Run to see the stage background! Click Submit and Next to progress.

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

# Program variables (DON'T DELETE!!!) block_speed = -6 # controls how fast the pipes move across the stage block_gap = 200 # controls the space between the top and bottom of each pipe block_interval = 1 # controls how often a new pipe appears gravity = 10 # controls how fast the sprite falls flappiness = 5 # controls how much the sprite moves up # Store and display score score = 0 score_text = codesters.Text("Score: " + str(score), 100, 200, "yellow") ######################################################################## # ADD CODE BELOW THIS LINE # ######################################################################## stage.set_background("space")
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)