Version of Robotron arcade game using LPC1768, a Gameduino shield, a serial EEPROM (for high scores), two microswitch joysticks and two buttons plus a box to put it in. 20 levels of mayhem.
Dependencies: 25LCxxx_SPI CommonTypes Gameduino mbed
Diff: ExplosionManager.h
- Revision:
- 8:82d88f9381f3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ExplosionManager.h Sat Jun 08 17:51:33 2013 +0000 @@ -0,0 +1,74 @@ +/* + * SOURCE FILE : ExplosionManager.h + * + * Responsible for managing a collection of explosions. + * + */ + +#ifndef ExplosionManagerIncluded + + #define ExplosionManagerIncluded + + #include "Types.h" + #include "ExplosionObject.h" + + class ExplosionManager { + + public : + + // An instance of this class. + static ExplosionManager Instance; + + enum { + MaxExplosions = 10, + }; + + /***************/ + /* CONSTRUCTOR */ + /***************/ + // Pass index of first sprite used for explosions in fsn. + ExplosionManager( UInt8 fsn ); + + /**************/ + /* DESTRUCTOR */ + /**************/ + ~ExplosionManager(); + + /**************************/ + /* START AN EXPLOSION OFF */ + /**************************/ + // Pass start coordinates in x and y (NOT pixel coordinates). + // Returns pointer to an ExplosionObject if it was started successfully or NULL if + // no more explosions are available at the moment. + ExplosionObject *StartExplosion( Int16 x, Int16 y ); + + /***********************/ + /* KILL ALL EXPLOSIONS */ + /***********************/ + void KillAllExplosions( void ); + + /**********************************************/ + /* GET ARRAY OF POINTERS TO EXPLOSION OBJECTS */ + /**********************************************/ + // Returns an array of pointers containing MaxExplosions items. + GameObject **GetExplosions( void ) { + return explosionPointers; + } + + private : + + // Sprite number for first sprite used for explosions. + UInt8 firstSpriteNumber; + + // Bank of explosion objects. + ExplosionObject explosions[ MaxExplosions ]; + + // Pointers to explosion objects. + GameObject *explosionPointers[ MaxExplosions ]; + + }; + +#endif + +/* END of ExplosionManager.h */ +