Game Development Reference
In-Depth Information
The finished script looks like the following screenshot:
To determine when to move the level up, an intuiive and simple way is to track how many
enemies are left. If all the enemies have been shot down, then the level should go up, right?
The answer is yes and no. Yes, if the game has very few enemy clones or if you do not use
cloning at all. However, for a game such as Space Age, which uses many broadcast messages
and clones, tracking the number of surviving enemies is not reliable. You can observe this
for yourself by going to the Data tab and checking the current_enemy_count checkbox.
Then, you can observe that the current enemy count does not always go down each ime you
shoot down an enemy, especially when the enemy clones are close to each other and you
fire ammo rapidly.
To help with this problem, Game Manager uses current_enemy_threshold . If current_enemy_
count becomes lower than current_enemy_threshold for that level, the game advances to
another level.
 
Search WWH ::




Custom Search