   Implementing Waves of Enemies - Classic Shooter Style
  Hi guys,Are there any good articles/threads here that cover the logic behind implementing/programming waves of enemies in a game similar to something like R-Type? I did search a few times but didn't find anything.Thanks,Si ++   
  You're not going to find anything this specific.  What this comes down to is common sense and general programming experience.  To create a wave of enemies, you'll need a collection of some kind.  A simple array will probably do fine, but depending on your programming language there will probably be a number of options.  Once you have the collection of enemies, all there is left is to move them onto the screen.  Add some scripting of some kind to define how many and what type of enemy and making waves of enemies will be easy.   ;  Thanks for the reply, I think I should have been a little more specific in my original post though. I'm more interested in how the waves are generated throughout a level, what determines when each wave is created etc. My initial guess is that each wave would be created at a set time, or are waves created back-to-back so when wave X has been destroyed or has moved off-screen wave Y is then created?I guess I'm just curious about how you guys would approach this, and hopefully I might pickup a few nuggets of wisdom along the way. :)   ;Quote:Original post by Si RobertsonThanks for the reply, I think I should have been a little more specific in my original post though. I'm more interested in how the waves are generated throughout a level, what determines when each wave is created etc. My initial guess is that each wave would be created at a set time, or are waves created back-to-back so when wave X has been destroyed or has moved off-screen wave Y is then created?I guess I'm just curious about how you guys would approach this, and hopefully I might pickup a few nuggets of wisdom along the way. :)One method might be to create a 2D array or vector, where the outer array stores the "waves" (inner arrays), and the inner arrays consist of the each individual enemy of that wave.  If you use a dynamic container (vector), you could generate just the first inner array (first wave), and only create the next inner array (next wave) when the first wave was destroyed by the player.  This way you do not waste memory by creating 10 waves when the player cannot even get past the first wave.  There are plenty of ways to do this, this is just my initial, basic idea.   ;Quote:Original post by Si RobertsonThanks for the reply, I think I should have been a little more specific in my original post though. I'm more interested in how the waves are generated throughout a level, what determines when each wave is created etc. My initial guess is that each wave would be created at a set time, or are waves created back-to-back so when wave X has been destroyed or has moved off-screen wave Y is then created?I did this just by defining "waves" in xml (basically a combination of an enemy type, a formation and a path to take), then having a list of waves and a time to trigger them at (again stored in xml). Bosses and sub-bosses might need behaviour to only trigger the next set of waves when they're destroyed however.Also, see this: http://www.flipcode.com/archives/Strayfire_Writing_A_Simple_Game.shtml   