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

Committer:
RichardE
Date:
Sat Jun 08 11:24:05 2013 +0000
Revision:
4:673eb9735d44
Child:
5:0b0651ac7832
Pulled in more code. Now panel controls are working. Level 0 (attract mode) now goes round an endless loop sending state of panel controls up serial port to PC.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RichardE 4:673eb9735d44 1 /*
RichardE 4:673eb9735d44 2 * SOURCE FILE : BulletManager.h
RichardE 4:673eb9735d44 3 *
RichardE 4:673eb9735d44 4 * Responsible for managing a collection of bullets.
RichardE 4:673eb9735d44 5 *
RichardE 4:673eb9735d44 6 */
RichardE 4:673eb9735d44 7
RichardE 4:673eb9735d44 8 #ifndef BulletManagerIncluded
RichardE 4:673eb9735d44 9
RichardE 4:673eb9735d44 10 #define BulletManagerIncluded
RichardE 4:673eb9735d44 11
RichardE 4:673eb9735d44 12 #include "Types.h"
RichardE 4:673eb9735d44 13 #include "BulletObject.h"
RichardE 4:673eb9735d44 14
RichardE 4:673eb9735d44 15 class BulletManager {
RichardE 4:673eb9735d44 16
RichardE 4:673eb9735d44 17 public :
RichardE 4:673eb9735d44 18
RichardE 4:673eb9735d44 19 enum {
RichardE 4:673eb9735d44 20 MaxBullets = 20, // maximum number of bullets on the go at one tine.
RichardE 4:673eb9735d44 21 };
RichardE 4:673eb9735d44 22
RichardE 4:673eb9735d44 23 /***************/
RichardE 4:673eb9735d44 24 /* CONSTRUCTOR */
RichardE 4:673eb9735d44 25 /***************/
RichardE 4:673eb9735d44 26 // Pass number of sprite to use for first bullet.
RichardE 4:673eb9735d44 27 // MaxBullets consequtive sprites will be used for bullets.
RichardE 4:673eb9735d44 28 BulletManager( UInt8 firstSpriteNumber );
RichardE 4:673eb9735d44 29
RichardE 4:673eb9735d44 30 /**********************/
RichardE 4:673eb9735d44 31 /* START A BULLET OFF */
RichardE 4:673eb9735d44 32 /**********************/
RichardE 4:673eb9735d44 33 // Pass start coordinates in x and y (NOT pixel coordinates).
RichardE 4:673eb9735d44 34 // Pass bullet velocities in hv and vv (NOT pixel velocities).
RichardE 4:673eb9735d44 35 // Returns true if bullet was started successfully.
RichardE 4:673eb9735d44 36 bool StartBullet( Int16 x, Int16 y, Int16 hv, Int16 vv );
RichardE 4:673eb9735d44 37
RichardE 4:673eb9735d44 38 /************************/
RichardE 4:673eb9735d44 39 /* KILL A SINGLE BULLET */
RichardE 4:673eb9735d44 40 /************************/
RichardE 4:673eb9735d44 41 // Pass index of bullet in b.
RichardE 4:673eb9735d44 42 void KillBullet( UInt8 b );
RichardE 4:673eb9735d44 43
RichardE 4:673eb9735d44 44 /********************/
RichardE 4:673eb9735d44 45 /* KILL ALL BULLETS */
RichardE 4:673eb9735d44 46 /********************/
RichardE 4:673eb9735d44 47 void KillAllBullets( void );
RichardE 4:673eb9735d44 48
RichardE 4:673eb9735d44 49 /************************************************/
RichardE 4:673eb9735d44 50 /* GET ARRAY CONTAINING POINTERS TO ALL BULLETS */
RichardE 4:673eb9735d44 51 /************************************************/
RichardE 4:673eb9735d44 52 // Returns pointer to array of GameObject pointers.
RichardE 4:673eb9735d44 53 // The array has BulletManager::MaxBullets pointers in it.
RichardE 4:673eb9735d44 54 GameObject **GetBullets( void ) {
RichardE 4:673eb9735d44 55 return bulletPointers;
RichardE 4:673eb9735d44 56 }
RichardE 4:673eb9735d44 57
RichardE 4:673eb9735d44 58 private :
RichardE 4:673eb9735d44 59
RichardE 4:673eb9735d44 60 // All the bullets.
RichardE 4:673eb9735d44 61 BulletObject bullets[ MaxBullets ];
RichardE 4:673eb9735d44 62
RichardE 4:673eb9735d44 63 // Pointers to all the bullets.
RichardE 4:673eb9735d44 64 // Entries in this array will be NULL for bullets that are not active.
RichardE 4:673eb9735d44 65 // When bullet is active it will point to the corresponding entry in the bullets array.
RichardE 4:673eb9735d44 66 GameObject *bulletPointers[ MaxBullets ];
RichardE 4:673eb9735d44 67
RichardE 4:673eb9735d44 68 };
RichardE 4:673eb9735d44 69
RichardE 4:673eb9735d44 70 #endif
RichardE 4:673eb9735d44 71
RichardE 4:673eb9735d44 72 /* END of BulletManager.h */
RichardE 4:673eb9735d44 73