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

Mission accomplished

This game has quite a lot going on and it uses a lot of different sprites. It can especially be hard to manage all these different elements. Keeping track of layers to simulate depth can be a challenge. With a bit of thought and planning, we can make it work.

Just remember the relevant information for each object. Think about what it needs to do and what it needs to know in order to do it. This way you can decide whether you need variables; whether these variables need to be made available to all the sprites or you can keep them only for a single sprite.

Then it's just a matter of turning desired actions into script commands like we did with the movement patterns. First, we thought of what the movement should look like. Then ...

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