Skip to main content

Stage 1: Create the Cube Runner

Stage 1: Create the Cube Runner

Course progressStage 1 of 10
~45 min
Your workspace

Keep your Scratch project tab open all week. Open in a new tab so you don’t leave the course.

Build

a Cube sprite and clean Scratch project

Learn

how sprite names and costumes become the foundation of a game

Ship

a player cube ready for jumping

Teacher demo
  1. Open the saved Scratch project and delete Scratch Cat.
  2. Create a new sprite named Cube. Either paint a square face or use the target cube as a drawing reference.
  3. Place it near the left side of the stage at x: -150 y: -90.
  4. Create variables ySpeed, gameOn, score, and gravity for all sprites.
  5. Click the green flag and show the cube resetting to the same place every time.

The big idea

A runner game works because the player stays predictable. The cube is the anchor. Everything else in the level scrolls toward it.

New words
sprite
a character or object in the Scratch project
costume
one look a sprite can wear
variable
a named value Scratch remembers while the game runs
reset
putting the game back into a known start state
Before you start

Setup should be complete. Your project is named Geometry Dash - First Last and saved to your Scratch account.

Use the examples

Follow the target shapes shown here so your scripts match the lesson quickly.

Make your own

Draw a custom cube, spikes, portal, or backdrop in Scratch. Keep the same sprite names so the code still works.

Build it

  1. Delete Scratch Cat, then make a new sprite named Cube.
  2. Paint a square with a face. Use bright colors and thick outlines so it reads clearly while moving.
  3. Make four variables for all sprites: ySpeed, gravity, gameOn, and score.
  4. Add the setup script below to the Cube sprite.
  5. Save the project after the cube resets correctly.

Cube setup script

when green flag clicked
set [gameOn v] to (1)
set [score v] to (0)
set [gravity v] to (-1)
set [ySpeed v] to (0)
go to x: (-150) y: (-90)
show
sprite

Cube

The sprite name Cube is required. Later scripts use the sprite dropdowns and collision checks by name, so lowercase or extra spaces can break the build.

Understand it

The green flag script is initialization. It makes every playtest start from the same state, which matters once the cube can crash, win, or restart.

Try this

Learning beat

Try this

Three short experiments. Predict before you run, then test your guess.

Predict first
Move the cube somewhere else, then click the green flag. Predict where it will land.
Compare
Try a tiny cube and a huge cube. Which one feels easier to read while moving?
Connect
Stage 2 needs ySpeed. What do you think a positive ySpeed should do to the cube?

Test your stage

  • The player sprite is named Cube exactly.
  • The cube starts at x: -150 y: -90 when the green flag is clicked.
  • Variables ySpeed, gravity, gameOn, and score exist for all sprites.
  • The project is saved.

If it breaks

  • If the cube does not move to the start spot, check that the script is on the Cube sprite.
  • If a variable is missing later, recreate it with the same spelling and choose For all sprites.
Coach notes

Keep students moving on the default path first. Custom assets are encouraged, but the required names and variables are not optional. If debugging takes more than a few minutes, compare the student's sprite names, variable names, and block order against the stage test list.