STEP 1: The first step is setting up the stage. Notice that some variables have been provided. Don't delete them!

  • Take a look at the provided variables. Read their names and comments. We'll use these later on in the game!
  • In the toolkit on the left side of your screen, find and click on it. Notice the blue blocks that appear.
  • Find the Space block. Click, hold, and drag it into the code editor below, then release.
  • Click Run to see the stage change. Click Submit to turn in your work and then click Next to move on.

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 # ########################################################################
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)