Design notes

Multiple asteroid classes

Different-sized asteroids have different characteristics, such as their graphic and their velocity. But that's not enough reason to give them separate classes. For example, different sized asteroids do different things when they explode: large asteroids break into medium asteroids, medium asteroids into small asteroids, and small asteroids into dust. Because C++ provides no easy way to specify dynamically which type of debris gets created, it's best to use polymorphism to get the correct effect.

Adding levels of difficulty

Currently, the game has only one level of difficulty (which repeats after each round of asteroids). However, the design of TSimulationLevel provides protocol for defining additional levels. It would be easy enough to define higher levels of difficulty based on more asteroids, faster moving asteroids, or new types
of antagonists.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker