Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have found this question with some very brilliant answers. I really like the "distance from bottom of the screen" spawning approach and the fact that the enemies flow can be easily visualized on an editor.

However I am an independent developer and do not have much time now to work on an editor. I am also using Cocos2D which allows me to place the enemies node in a position relative to layers and hence if I choose a certain spawning position it can be relative to the screen layer and not to the map relative position.

So my editor is a function call that calls a series of the following methods:

-(void) loadEnemiesSpritesForLevelOne{
    [enemiesSprites addObject: [EnemyEntity enemyWithTypeAndSpawnTimeAndMovementTyp:CoolEnemy :3.0f :BezierSemicurveA :CGPointMake(160.0f, 480.0f)]];
    [enemiesSprites addObject: [EnemyEntity enemyWithTypeAndSpawnTimeAndMovementTyp:CoolEnemy :5.0f :BezierSemicurveA :CGPointMake(60.0f, 480.0f)]];
    [enemiesSprites addObject: [EnemyEntity enemyWithTypeAndSpawnTimeAndMovementTyp:StupidEnemy :7.0f :BezierSemicurveA :CGPointMake(60.0f, 480.0f)]];
    ...etc...
    [enemiesSprites addObject: [EnemyEntity enemyWithTypeAndSpawnTimeAndMovementTyp:BigBoss :104.0f :BezierSemicurveA :CGPointMake(160.0f, 480.0f)]];
}

where: - enemiesSprites is an array of enemies objects that gets parsed when the "scene update" method is called - when the spawn time arrives the enemy spawn method is called

Is there anything bad on this approach or any improvements I could apply?

share|improve this question
1  
You could consider storing all of the level-specific game data in config files (perhaps XML?) and the load them using that. Then have a method like loadLevel("level1.xml"). – Supericy Mar 15 at 16:19

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.