STEP 4: The user playing the game may need some instructions. Our sprite can explain how to play!

  • Drag Say for Time onto the next line. Change the number in the parentheses from 2 to 3.
  • Change the message to "TAP THE SPACEBAR TO GUIDE ME THROUGH THE BLOCKS!"
  • Drag out Go To next and change the coordinates in the parentheses to (-200, 0)
  • Click Run to see the instructions! In the next activity we'll start the game.

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") stage.disable_all_walls() sprite = codesters.Sprite("dinosaur") sprite.set_size(0.4) sprite.set_say_color("yellow")
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)