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: BlueMeanyObject.h
- Revision:
- 8:82d88f9381f3
- Child:
- 13:50779b12ff51
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BlueMeanyObject.h Sat Jun 08 17:51:33 2013 +0000 @@ -0,0 +1,79 @@ +/* + * SOURCE FILE : BlueMeanyObject.h + * + * Represents the BlueMeany enemy object. + * + */ + +#ifndef BlueMeanyObjectIncluded + + #define BlueMeanyObjectIncluded + + #include "EnemyObject.h" + #include "SpriteImageId.h" + #include "FrameCounter.h" + + class BlueMeanyObject : public EnemyObject { + + public : + + /***************/ + /* CONSTRUCTOR */ + /***************/ + BlueMeanyObject() : + hVelocity( 0 ), + vVelocity( 0 ) + { + } + + /**************/ + /* DESTRUCTOR */ + /**************/ + virtual ~BlueMeanyObject() { + } + + /*****************************/ + /* GET TYPE OF ENEMY THIS IS */ + /*****************************/ + // Returns enemy type. + virtual EnemyType GetEnemyType( void ) { + return BlueMeany; + } + + /*******************************************************/ + /* GET NUMBER OF POINTS AWARDED FOR KILLING THIS ENEMY */ + /*******************************************************/ + // Returns number of points. + virtual UInt8 GetPoints( void ) { + return 0x10; // BCD! + } + + /************************/ + /* MOVE THE GAME OBJECT */ + /************************/ + virtual void ProtectedMove( void ); + + /************************/ + /* DRAW THE GAME OBJECT */ + /************************/ + // This is only called after it has been established that the + // game object is visible. + virtual void Draw( Gameduino *gd ) { + Gameduino::Rotation transform = ( Xco < chaseObject->Xco ) ? Gameduino::FlipX : Gameduino::None; + gd->sprite( SpriteNumber, ToPixel( Xco ), ToPixel( Yco ), BlueMeanyImage, 0, transform, BadGuy ); + } + + private : + + enum { + MaxBlueMeanyVelocity = 64, + }; + + // Horizontal and vertical velocities. NOT in pixels. + Int16 hVelocity, vVelocity; + + }; + +#endif + +/* END of BlueMeanyObject.h */