Game Development Reference
In-Depth Information
Game Manager has a Configure Level () block that allows the user to conigure exising
levels or add new levels. Game Manager stores the coniguraion of each level in three lists:
enemyTypeList , enemyCountList , and enemyThresholdList . The enemyTypeList stores the
enemy sprite types for all the levels; the enemyCountList stores the enemy counts
(how many enemy clones to create); the levelTimeoutList stores the level imeout.
The Configure Level () block is already included in the starter project so that one can test the
other sprites. Let's take a look inside the Configure Level () block:
1.
This block is called Configure Level: <level_num> enemyType: <type> enemyCount:
<count> enemyThreshold: <threshold > . The <level_num> input variable is the
next level number; the <count> variable shows how many enemy clones are to be
created for the next level, and <type> shows the type of enemy sprite to be created;
the <threshold> variable shows how low the enemy count has to go before moving
up a level.
2.
Next, add <type> to <enemyTypeList> . If the entry is already there, use update
instead of insert . Check condiion if (length of enemyTypeList) is smaller than
<level_num> . If yes, add insert <type> at <level_num> of enemyTypeList .
Else, add replace item <level_num> of enemyTypeList with <type> .
3.
Next, add <count> to <enemyCountList> . If the entry is already there, use update
instead of insert . Check condiion if (length of enemyCountList) is smaller than
<level_num> . If yes, add insert <count> at <level_num> of enemyCountList .
Else, add replace item <level_num> of enemyCountList with <count> .
4.
Finally, add <threshold> to <enemyThresholdList> . If the entry is already there,
use update instead of insert . Check condiion if (length of enemyThresholdList)
is smaller than <level_num> . If yes, add insert <threshold> at <level_num> of
enemyThresholdList . Else, add replace item <level_num> of enemyThresholdList
with <threshold> .
 
Search WWH ::




Custom Search