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

Committer:
RichardE
Date:
Sat Jun 15 15:05:19 2013 +0000
Revision:
15:d8ea0c7b7e64
Parent:
14:46a353b2a8e8
Child:
16:d0b142ba4362
Started adding code to represent a grid of rectangles which is used on high score entry screen. See FieldGrid, FieldRow and FieldCell classes and use in HighScoreEntry.cpp.

Who changed what in which revision?

UserRevisionLine numberNew 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 15:d8ea0c7b7e64 17 #include "FieldGrid.h" // grid around which cursor moves
RichardE 0:5fa232ee5fdf 18
RichardE 0:5fa232ee5fdf 19 class HighScoreEntry {
RichardE 0:5fa232ee5fdf 20
RichardE 0:5fa232ee5fdf 21 public :
RichardE 0:5fa232ee5fdf 22
RichardE 0:5fa232ee5fdf 23 /***************/
RichardE 0:5fa232ee5fdf 24 /* CONSTRUCTOR */
RichardE 0:5fa232ee5fdf 25 /***************/
RichardE 0:5fa232ee5fdf 26 HighScoreEntry();
RichardE 0:5fa232ee5fdf 27
RichardE 0:5fa232ee5fdf 28 /**************/
RichardE 0:5fa232ee5fdf 29 /* DESTRUCTOR */
RichardE 0:5fa232ee5fdf 30 /**************/
RichardE 0:5fa232ee5fdf 31 virtual ~HighScoreEntry();
RichardE 0:5fa232ee5fdf 32
RichardE 0:5fa232ee5fdf 33 /*********************/
RichardE 0:5fa232ee5fdf 34 /* GET A PLAYER NAME */
RichardE 0:5fa232ee5fdf 35 /*********************/
RichardE 0:5fa232ee5fdf 36 // Pass pointer to place to store name in name.
RichardE 0:5fa232ee5fdf 37 // Pass pointer to controls to read in controls.
RichardE 4:673eb9735d44 38 // Pass pointer to Gameduino to display on in gd.
RichardE 4:673eb9735d44 39 void GetName( PlayerName *name, PanelControls *controls, Gameduino *gd );
RichardE 0:5fa232ee5fdf 40
RichardE 0:5fa232ee5fdf 41 private :
RichardE 0:5fa232ee5fdf 42
RichardE 0:5fa232ee5fdf 43 // Position of cursor (zero for first character).
RichardE 0:5fa232ee5fdf 44 UInt8 cursorPos;
RichardE 0:5fa232ee5fdf 45
RichardE 15:d8ea0c7b7e64 46 // Grid around which cursor moves.
RichardE 15:d8ea0c7b7e64 47 FieldGrid grid;
RichardE 15:d8ea0c7b7e64 48
RichardE 15:d8ea0c7b7e64 49 /*******************/
RichardE 15:d8ea0c7b7e64 50 /* INITIALISE GRID */
RichardE 15:d8ea0c7b7e64 51 /*******************/
RichardE 15:d8ea0c7b7e64 52 void InitialiseGrid( void );
RichardE 15:d8ea0c7b7e64 53
RichardE 0:5fa232ee5fdf 54 /*********************/
RichardE 0:5fa232ee5fdf 55 /* WAIT FOR CONTROLS */
RichardE 0:5fa232ee5fdf 56 /*********************/
RichardE 4:673eb9735d44 57 // Pass pointer to Gameduino to display on in gd.
RichardE 0:5fa232ee5fdf 58 // Pass pointer to controls to read in controls.
RichardE 0:5fa232ee5fdf 59 // Pass true in waitActivate to wait for a control to be used.
RichardE 0:5fa232ee5fdf 60 // Pass false to wait for release.
RichardE 4:673eb9735d44 61 void WaitControls( Gameduino *gd, PanelControls *controls, bool waitActivate );
RichardE 0:5fa232ee5fdf 62
RichardE 0:5fa232ee5fdf 63 /*******************/
RichardE 0:5fa232ee5fdf 64 /* DRAW THE SCREEN */
RichardE 0:5fa232ee5fdf 65 /*******************/
RichardE 4:673eb9735d44 66 // Pass pointer to Gameduino to display on in gd.
RichardE 4:673eb9735d44 67 void DrawScreen( Gameduino *gd );
RichardE 0:5fa232ee5fdf 68
RichardE 14:46a353b2a8e8 69 /***************************/
RichardE 14:46a353b2a8e8 70 /* DRAW THE CHARACTER GRID */
RichardE 14:46a353b2a8e8 71 /***************************/
RichardE 14:46a353b2a8e8 72 // Pass pointer to Gameduino to draw on in gd.
RichardE 14:46a353b2a8e8 73 void DrawGrid( Gameduino *gd );
RichardE 14:46a353b2a8e8 74
RichardE 0:5fa232ee5fdf 75 /********************************/
RichardE 0:5fa232ee5fdf 76 /* DRAW THE NAME AND THE CURSOR */
RichardE 0:5fa232ee5fdf 77 /********************************/
RichardE 4:673eb9735d44 78 // Pass pointer to Gameduino to display on in gd.
RichardE 0:5fa232ee5fdf 79 // Pass player name in name.
RichardE 4:673eb9735d44 80 void DrawName( Gameduino *gd, PlayerName *name );
RichardE 0:5fa232ee5fdf 81
RichardE 0:5fa232ee5fdf 82 /********************/
RichardE 0:5fa232ee5fdf 83 /* UPDATE ANIMATION */
RichardE 0:5fa232ee5fdf 84 /********************/
RichardE 4:673eb9735d44 85 // Pass pointer to Gameduino to display on in gd.
RichardE 4:673eb9735d44 86 void Animate( Gameduino *gd );
RichardE 0:5fa232ee5fdf 87
RichardE 0:5fa232ee5fdf 88 };
RichardE 0:5fa232ee5fdf 89
RichardE 0:5fa232ee5fdf 90 #endif
RichardE 0:5fa232ee5fdf 91
RichardE 0:5fa232ee5fdf 92 /* END of HighScoreEntry.h */
RichardE 0:5fa232ee5fdf 93