![](/media/cache/profiles/859bf1416b8b8761c5d588dee78dc65f.50x50_q85.jpg)
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
HighScoreEntry.h@14:46a353b2a8e8, 2013-06-11 (annotated)
- Committer:
- RichardE
- Date:
- Tue Jun 11 21:04:48 2013 +0000
- Revision:
- 14:46a353b2a8e8
- Parent:
- 4:673eb9735d44
- Child:
- 15:d8ea0c7b7e64
Started to modify how high scores are entered but not finished. Currently asks for a name when program first starts. Remove this code later.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RichardE | 0:5fa232ee5fdf | 1 | /* |
RichardE | 0:5fa232ee5fdf | 2 | * SOURCE FILE : HighScoreEntry.h |
RichardE | 0:5fa232ee5fdf | 3 | * |
RichardE | 0:5fa232ee5fdf | 4 | * Definition of class HighScoreEntry. |
RichardE | 0:5fa232ee5fdf | 5 | * Routine to allow player to enter their name using joysticks. |
RichardE | 0:5fa232ee5fdf | 6 | * |
RichardE | 0:5fa232ee5fdf | 7 | */ |
RichardE | 0:5fa232ee5fdf | 8 | |
RichardE | 0:5fa232ee5fdf | 9 | #ifndef HighScoreEntryDefined |
RichardE | 0:5fa232ee5fdf | 10 | |
RichardE | 0:5fa232ee5fdf | 11 | #define HighScoreEntryDefined |
RichardE | 0:5fa232ee5fdf | 12 | |
RichardE | 0:5fa232ee5fdf | 13 | #include "Types.h" |
RichardE | 4:673eb9735d44 | 14 | #include "PanelControls.h" // for reading panel controls. |
RichardE | 0:5fa232ee5fdf | 15 | #include "PlayerName.h" |
RichardE | 4:673eb9735d44 | 16 | #include "Gameduino.h" |
RichardE | 0:5fa232ee5fdf | 17 | |
RichardE | 0:5fa232ee5fdf | 18 | class HighScoreEntry { |
RichardE | 0:5fa232ee5fdf | 19 | |
RichardE | 0:5fa232ee5fdf | 20 | public : |
RichardE | 0:5fa232ee5fdf | 21 | |
RichardE | 0:5fa232ee5fdf | 22 | /***************/ |
RichardE | 0:5fa232ee5fdf | 23 | /* CONSTRUCTOR */ |
RichardE | 0:5fa232ee5fdf | 24 | /***************/ |
RichardE | 0:5fa232ee5fdf | 25 | HighScoreEntry(); |
RichardE | 0:5fa232ee5fdf | 26 | |
RichardE | 0:5fa232ee5fdf | 27 | /**************/ |
RichardE | 0:5fa232ee5fdf | 28 | /* DESTRUCTOR */ |
RichardE | 0:5fa232ee5fdf | 29 | /**************/ |
RichardE | 0:5fa232ee5fdf | 30 | virtual ~HighScoreEntry(); |
RichardE | 0:5fa232ee5fdf | 31 | |
RichardE | 0:5fa232ee5fdf | 32 | /*********************/ |
RichardE | 0:5fa232ee5fdf | 33 | /* GET A PLAYER NAME */ |
RichardE | 0:5fa232ee5fdf | 34 | /*********************/ |
RichardE | 0:5fa232ee5fdf | 35 | // Pass pointer to place to store name in name. |
RichardE | 0:5fa232ee5fdf | 36 | // Pass pointer to controls to read in controls. |
RichardE | 4:673eb9735d44 | 37 | // Pass pointer to Gameduino to display on in gd. |
RichardE | 4:673eb9735d44 | 38 | void GetName( PlayerName *name, PanelControls *controls, Gameduino *gd ); |
RichardE | 0:5fa232ee5fdf | 39 | |
RichardE | 0:5fa232ee5fdf | 40 | private : |
RichardE | 0:5fa232ee5fdf | 41 | |
RichardE | 0:5fa232ee5fdf | 42 | // Position of cursor (zero for first character). |
RichardE | 0:5fa232ee5fdf | 43 | UInt8 cursorPos; |
RichardE | 0:5fa232ee5fdf | 44 | |
RichardE | 0:5fa232ee5fdf | 45 | /*********************/ |
RichardE | 0:5fa232ee5fdf | 46 | /* WAIT FOR CONTROLS */ |
RichardE | 0:5fa232ee5fdf | 47 | /*********************/ |
RichardE | 4:673eb9735d44 | 48 | // Pass pointer to Gameduino to display on in gd. |
RichardE | 0:5fa232ee5fdf | 49 | // Pass pointer to controls to read in controls. |
RichardE | 0:5fa232ee5fdf | 50 | // Pass true in waitActivate to wait for a control to be used. |
RichardE | 0:5fa232ee5fdf | 51 | // Pass false to wait for release. |
RichardE | 4:673eb9735d44 | 52 | void WaitControls( Gameduino *gd, PanelControls *controls, bool waitActivate ); |
RichardE | 0:5fa232ee5fdf | 53 | |
RichardE | 0:5fa232ee5fdf | 54 | /*******************/ |
RichardE | 0:5fa232ee5fdf | 55 | /* DRAW THE SCREEN */ |
RichardE | 0:5fa232ee5fdf | 56 | /*******************/ |
RichardE | 4:673eb9735d44 | 57 | // Pass pointer to Gameduino to display on in gd. |
RichardE | 4:673eb9735d44 | 58 | void DrawScreen( Gameduino *gd ); |
RichardE | 0:5fa232ee5fdf | 59 | |
RichardE | 14:46a353b2a8e8 | 60 | /***************************/ |
RichardE | 14:46a353b2a8e8 | 61 | /* DRAW THE CHARACTER GRID */ |
RichardE | 14:46a353b2a8e8 | 62 | /***************************/ |
RichardE | 14:46a353b2a8e8 | 63 | // Pass pointer to Gameduino to draw on in gd. |
RichardE | 14:46a353b2a8e8 | 64 | void DrawGrid( Gameduino *gd ); |
RichardE | 14:46a353b2a8e8 | 65 | |
RichardE | 0:5fa232ee5fdf | 66 | /********************************/ |
RichardE | 0:5fa232ee5fdf | 67 | /* DRAW THE NAME AND THE CURSOR */ |
RichardE | 0:5fa232ee5fdf | 68 | /********************************/ |
RichardE | 4:673eb9735d44 | 69 | // Pass pointer to Gameduino to display on in gd. |
RichardE | 0:5fa232ee5fdf | 70 | // Pass player name in name. |
RichardE | 4:673eb9735d44 | 71 | void DrawName( Gameduino *gd, PlayerName *name ); |
RichardE | 0:5fa232ee5fdf | 72 | |
RichardE | 0:5fa232ee5fdf | 73 | /********************/ |
RichardE | 0:5fa232ee5fdf | 74 | /* UPDATE ANIMATION */ |
RichardE | 0:5fa232ee5fdf | 75 | /********************/ |
RichardE | 4:673eb9735d44 | 76 | // Pass pointer to Gameduino to display on in gd. |
RichardE | 4:673eb9735d44 | 77 | void Animate( Gameduino *gd ); |
RichardE | 0:5fa232ee5fdf | 78 | |
RichardE | 0:5fa232ee5fdf | 79 | }; |
RichardE | 0:5fa232ee5fdf | 80 | |
RichardE | 0:5fa232ee5fdf | 81 | #endif |
RichardE | 0:5fa232ee5fdf | 82 | |
RichardE | 0:5fa232ee5fdf | 83 | /* END of HighScoreEntry.h */ |
RichardE | 0:5fa232ee5fdf | 84 |