meurig phillips snake game - accidentally published to my account instead of to the group!
Dependencies: Joystick N5110 SDFileSystem beep fsmMenu mbed
Fork of SnakeProjectRev1 by
Diff: main.h
- Revision:
- 12:825a402d230f
- Parent:
- 11:f8478bc749e0
- Child:
- 13:08159ea3d556
--- a/main.h Sun May 01 12:15:09 2016 +0000 +++ b/main.h Sun May 01 13:46:08 2016 +0000 @@ -24,10 +24,6 @@ DigitalOut redLed(PTA2); //Beep buzzer(PTA1); -Ticker pollJoystick; /// timer to regularly read the joystick -Serial serial(USBTX,USBRX); /// serial communication for debugging -Ticker gameTicker; /// timer to update game at regular intervals - /// create enumerated type (0,1,2,3 etc. for current direction snake is travelling (not joystick reading)) enum CurrentDirection { up, @@ -38,6 +34,7 @@ }; CurrentDirection currentDirection = centre; /// intialise direction at beginning +float gameSpeed = 0.1; /*!< determines speed of game according to pot value */ int randomX = rand() % 83 + 1; /*!< random number in the range of 1 to 83 assigned to randomX */ int randomY = rand() % 47 + 1; /*!< random number in the range of 1 to 47 assigned to randomY */ int randomXoddEven = randomX%2; /*!< distinguish whether randomX is odd or even */ @@ -55,6 +52,7 @@ int prev2_i; /*!< integer to store previous, previous value of x/i */ int prev2_j; /*!< integer to store previous, previous value of y/j */ bool gamePlaying = false; /*!< bool to store whether the game is in play or not */ +int pauseCount; /*!< counts how many times the player has paused */ /** @@ -97,6 +95,10 @@ Splash screen for the intro of the game */ void snakeIntro(); +/** +Game paused function +*/ +void gamePaused(); #endif \ No newline at end of file