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 complete level list when we are done:
Essentially, we are going to add level information for the two new levels to the three lists: the enemy type, enemy count, and level timeout lists. According to the following diagram, level one has 15 Rock clones...