Game Development Reference
In-Depth Information
different points in time. If you replay a level over and over again, you will
notice the waves of enemies are always the same. This is more interesting
than the approach used in Ship Attack , where enemies only spawn on a set
timer.
In order to have structured waves, you want to add some sort of class to
manage the spawning of waves. You also need some way to define the
timing of enemies spawning. One way to d this would be to have a list of
all the enemy spawns, essentially detailing the point in time, the type of
enemy, and the position of the spawn. The spawn manager then could
keep track of the overall elapsed time and spawn the appropriate enemies.
Summary
Our discussion of Ship Attack should have given you an idea of how to implement
asimple-yet-interesting 2Dside-scroller.Because it'sa2Dgame,itemploysmany
of the techniques discussed in Chapter 2 . This discussion also touched on a bit of
physics (which was covered in Chapter 7 ) through the use of Euler integration as
well as AABB collision detection. From the basic building blocks provided by this
game, it would certainly be possible to create more complex and interesting ver-
sions.
Search WWH ::




Custom Search