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

Adding scores and power-ups

To prepare for the upcoming boss battle (next project), it's a nice touch to power up the player character. A power-up system also offers a better reason for shooting enemies apart from the need for survival.

Engage thrusters

We will assign a score value to each enemy type. The player can increase the score by shooting the enemy of the corresponding type. When the player has defeated enough enemies, the spear will be powered up in some way.

  1. We have three different enemy types, so we will first create the following three new variables to hold the scores. These variables are available for all sprites.
    • scoreRed
    • scoreBlue
    • scoreYellow
  2. Click on the checkboxes in front of the new variables to make them visible on the stage. This ...

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