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.
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 and would advance when current enemy count goes below 3:
To do so, we need to update Game Manager's scripts. Go to Game Manager's Scripts tab to find the when <green flag> clicked script, and add the following levels to it:
The steps to add two additional levels are as follows:
2
to 4
.2
to level 4
in the Configure Level: 2 block to make Configure Level: 4 enemyType: Mother Ship enemyCount: 1 enemyThreshold: 1.There we have it. We've added two additional levels in three simple steps. The resulting script is as shown in the following screenshot:
There, we did it! We have added two levels in three simple steps, check out the Classified intel section on updating Space Age to have more than seven levels.
The Enemy Ammo and Game Manager sprites come with enough costumes to go up to seven levels. This means that you can add up to seven levels with the steps described in this section.
To add more than seven levels, you need to add the matching number of costumes to both the Enemy Ammo and Game Manager sprites. For example, if you are really ambitious and want to have 100 levels in Space Age, you need to have at least 100 costumes for the Enemy Ammo and Game Manager sprites.
3.142.114.19