Racing Cars game using N5110 LCD and thumb Joystick
Dependencies: N5110 PowerControl beep mbed
Diff: main.h
- Revision:
- 7:edf0f1fcb16b
- Parent:
- 6:289f237b8d90
- Child:
- 8:699055e89c7d
--- a/main.h Fri May 08 00:38:01 2015 +0000 +++ b/main.h Fri May 08 12:58:22 2015 +0000 @@ -99,6 +99,13 @@ int startButtonFlag=0; int resetButtonFlag=0; + +char livesBuffer[1]; +char roundBuffer[1]; +char coinsBuffer[2]; +char soundString[3]; // Create buffer String that stores the sound state String("YES","NO") +char brightnessBuffer[2]; + int gamePlays=1; int sounds=1; int coinAppear=1; @@ -126,9 +133,9 @@ int xPos=6; /** initial Game States, Number of lives, Number of coins, Round Number */ -int lives=5; -int coins=0; -int round=1; +int lives; +int coins; +int round; /** brightness Initial Values, brightnessDisplay is the value displayed to the user */ float brightness=0.9; @@ -147,7 +154,7 @@ * Draws the lanes of the road, that are fixed. * This function is called when the player moves on the screen and pixels need to be reset */ -void gameInitial(); +void gameLanes(); /** Initialise Table Array @@ -280,12 +287,34 @@ */ void startButtonPressed();//Function that checks for an Interupt at pin 24 +/** Start Button Pressed Function +* Flips the Start Button Flag indicator showing that button was pressed +*/ void resetButtonPressed();//Function that checks for an Interupt at pin 25 +/** Set Line's Cells Function +* Sets the cells of a line equal to 2 +* @param x0 - x-coordinate of first point +* @param y0 - y-coordinate of first point +* @param x1 - x-coordinate of last point +* @param y1 - y-coordinate of last point +* @param type - 0 white,1 black,2 dotted +*/ void setLineCells(int x0,int y0,int x1,int y1,int type); + +/** Clear Line's Cells Function +* Clears the cells of a line(set them equal to 0) +* @param x0 - x-coordinate of first point +* @param y0 - y-coordinate of first point +* @param x1 - x-coordinate of last point +* @param y1 - y-coordinate of last point +* @param type - 0 white,1 black,2 dotted +*/ void clearLineCells(int x0,int y0,int x1,int y1,int type); -extern "C" void mbed_reset(); -void gameInitialise(); \ No newline at end of file +/** Initialisation Game Function +* Sets the initial game values +*/ +void gameReset(); \ No newline at end of file