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@4:673eb9735d44, 2013-06-08 (annotated)
- Committer:
- RichardE
- Date:
- Sat Jun 08 11:24:05 2013 +0000
- Revision:
- 4:673eb9735d44
- Parent:
- 0:5fa232ee5fdf
- Child:
- 14:46a353b2a8e8
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?
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 | 0:5fa232ee5fdf | 60 | /********************************/ |
RichardE | 0:5fa232ee5fdf | 61 | /* DRAW THE NAME AND THE CURSOR */ |
RichardE | 0:5fa232ee5fdf | 62 | /********************************/ |
RichardE | 4:673eb9735d44 | 63 | // Pass pointer to Gameduino to display on in gd. |
RichardE | 0:5fa232ee5fdf | 64 | // Pass player name in name. |
RichardE | 4:673eb9735d44 | 65 | void DrawName( Gameduino *gd, PlayerName *name ); |
RichardE | 0:5fa232ee5fdf | 66 | |
RichardE | 0:5fa232ee5fdf | 67 | /********************/ |
RichardE | 0:5fa232ee5fdf | 68 | /* UPDATE ANIMATION */ |
RichardE | 0:5fa232ee5fdf | 69 | /********************/ |
RichardE | 4:673eb9735d44 | 70 | // Pass pointer to Gameduino to display on in gd. |
RichardE | 4:673eb9735d44 | 71 | void Animate( Gameduino *gd ); |
RichardE | 0:5fa232ee5fdf | 72 | |
RichardE | 0:5fa232ee5fdf | 73 | }; |
RichardE | 0:5fa232ee5fdf | 74 | |
RichardE | 0:5fa232ee5fdf | 75 | #endif |
RichardE | 0:5fa232ee5fdf | 76 | |
RichardE | 0:5fa232ee5fdf | 77 | /* END of HighScoreEntry.h */ |
RichardE | 0:5fa232ee5fdf | 78 |