O'Reilly logo

Scratch 2.0 Game Development HOTSHOT by Sergio van Pul, Jessica Chiang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Winning the game

Just one more thing to do to finish the game. At the moment, the enemies can win the game by destroying the base. But the player can't really win the game. There's no clear end state to kill all the enemies. To finish the game, we will determine fixed winning and losing conditions and add a game screen to clearly tell the player whether they have won or lost the game.

Prepare for lift off

Let's create the screen graphic first by following the given steps:

  1. Click on the paintbrush icon to create a new sprite.
  2. Choose a dark yellow color and draw a large rectangle.
  3. Click on Fill to fill the rectangle with a light yellow color.
  4. Select the Text tool and write the text YOU WIN! in the center of the rectangle.
  5. Duplicate the costume by selecting ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required