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 scripts to Shield and Shield Life

Shield protects and is also protected by the Spaceship. Each time the enemy sprite collides into it, Shield will lose one grid of power, displayed by Shield Life.

Adding scripts to Shield and Shield Life

When the power is gone (all red), Shield is destroyed and the game is over.

Adding scripts to Shield and Shield Life

Shield Life displays the shield power grid by changing its costumes, each at a power grid damage level. The technique to display damage level with costumes is to match the costume number with the number of hits. Scratch costumes start from one, instead of zero, so costume#1 ...

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