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: GruntObject.h
- Revision:
- 7:e72691603fd3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GruntObject.h Sat Jun 08 16:44:54 2013 +0000 @@ -0,0 +1,74 @@ +/* + * SOURCE FILE : GruntObject.h + * + * Represents the grunt enemy object. + * + */ + +#ifndef GruntObjectIncluded + + #define GruntObjectIncluded + + #include "EnemyObject.h" + #include "SpriteImageId.h" + #include "FrameCounter.h" + + class GruntObject : public EnemyObject { + + public : + + /***************/ + /* CONSTRUCTOR */ + /***************/ + GruntObject() { + } + + /**************/ + /* DESTRUCTOR */ + /**************/ + virtual ~GruntObject() { + } + + /*****************************/ + /* GET TYPE OF ENEMY THIS IS */ + /*****************************/ + // Returns enemy type. + virtual EnemyType GetEnemyType( void ) { + return Grunt; + } + + /*******************************************************/ + /* GET NUMBER OF POINTS AWARDED FOR KILLING THIS ENEMY */ + /*******************************************************/ + // Returns number of points. + virtual UInt8 GetPoints( void ) { + return 0x5; // In BCD! + } + + /************************/ + /* MOVE THE GAME OBJECT */ + /************************/ + virtual void ProtectedMove( void ); + + /************************/ + /* DRAW THE GAME OBJECT */ + /************************/ + // Pass Gameduino to draw on in gd. + // This is only called after it has been established that the + // game object is visible. + virtual void Draw( Gameduino *gd ) { + Gameduino::Rotation transform = ( FrameCounter & 8 ) ? Gameduino::FlipX : Gameduino::None; + gd->sprite( SpriteNumber, ToPixel( Xco ), ToPixel( Yco ), GruntImage, 0, transform, BadGuy ); + } + + private : + + // Speed at which grunts move. + static Int16 gruntSpeed; + + }; + +#endif + +/* END of GruntObject.h */ +