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
GruntObject.h
- Committer:
- RichardE
- Date:
- 2013-06-17
- Revision:
- 18:70190f956a24
- Parent:
- 7:e72691603fd3
File content as of revision 18:70190f956a24:
/* * 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 */