Adding levels – three simple steps

If you have not done so, test the current code. If you are a good gamer, you should ace this and finish both levels in no time. To make the game harder to beat and more interesting, let's add two new levels using Monster and Robot.

Prepare for lift off

For each game level, there are different enemy types, enemy counts, and level timeouts. The enemy type is the name of the enemy sprite, enemy count is the number of enemies to create, and the level timeout is the maximum time each level lasts. The level can move up before the level timeout if enough enemies are eliminated.

With the Configure Level () block, it's very easy to add new levels and we will do just that in this section. The following screenshot shows the ...

Get Scratch 2.0 Game Development HOTSHOT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.