Menu class used as basis for program; running the game and allowing the user to change the style and difficulty of the game via an interface.
Diff: Menu.h
- Revision:
- 4:4f20bcef2c0c
- Parent:
- 3:a79daa7c2b55
- Child:
- 5:56f13954666e
--- a/Menu.h Sun Apr 16 12:31:48 2017 +0000 +++ b/Menu.h Mon May 01 09:13:40 2017 +0000 @@ -10,6 +10,8 @@ #ifndef MENU_H #define MENU_H +#include <stdlib.h> // used to generate random number values + #include "mbed.h" #include "N5110.h" #include "Gamepad.h" @@ -17,7 +19,6 @@ #include "Animations.h" #include "Maze.h" #include "Ball.h" -#include "Sound.h" class Menu { @@ -28,30 +29,59 @@ ~Menu(); void init(); - void main(N5110 &lcd, Gamepad &pad, FXOS8700CQ &device, Sound &tune, Animations &animate); - void intro(N5110 &lcd, Gamepad &pad, Sound &tune, Animations &animate); - void playGame(N5110 &lcd, Gamepad &pad, FXOS8700CQ &device, Sound &tune, int mazeIndex); - void options(N5110 &lcd, Gamepad &pad, Animations &animate); - void lcdSettings(N5110 &lcd, Gamepad &pad); - void soundSettings(N5110 &lcd, Gamepad &pad); - void controlOptions(N5110 &lcd, Gamepad &pad, Animations &animate); - void difficultyOptions(N5110 &lcd, Gamepad &pad); - void lcdColourOptions(N5110 &lcd, Gamepad &pad); - void lcdInverseColour(N5110 &lcd, Gamepad &pad); - void lcdBackgroundColour(N5110 &lcd, Gamepad &pad); - void animateJoystick(N5110 &lcd, Gamepad &pad, Animations &animate); - void animateGamepad(N5110 &lcd, Gamepad &pad, Animations &animate); - void soundEffects(N5110 &lcd, Gamepad &pad); - void musicSettings(N5110 &lcd, Gamepad &pad); + void main(N5110 &lcd, + Gamepad &pad, + FXOS8700CQ &device, + Animations &animate); + + void intro(N5110 &lcd, Gamepad &pad, Animations &animate); private: + void printGameParameters(int mazeIndex, + int x, + int y, + int radius, + bool control, + bool colour, + float FPS); + + void playGame(N5110 &lcd, + Gamepad &pad, + FXOS8700CQ &device, + Animations &animate, + int mazeIndex, + bool tone, + float FPS); + + void options(N5110 &lcd, Gamepad &pad, Animations &animate, bool tone); + void lcdSettings(N5110 &lcd, Gamepad &pad, Animations &animate); + void soundSettings(N5110 &lcd, Gamepad &pad, Animations &animate); + void controlOptions(N5110 &lcd, Gamepad &pad, Animations &animate); + void difficultyOptions(N5110 &lcd, Gamepad &pad); + void ballColourOptions(N5110 &lcd, Gamepad &pad, Animations &animate); + void lcdInverseColour(N5110 &lcd, Gamepad &pad); + void lcdBackgroundColour(N5110 &lcd, Gamepad &pad, Animations &animate); + + void animateJoystick(N5110 &lcd, Animations &animate); + void animateGamepad(N5110 &lcd, Animations &animate); + void animateStickman(N5110 &lcd, Gamepad &pad, Animations &animate); + + void soundEffects(N5110 &lcd, Gamepad &pad, Animations &animate); + void speedSettings(N5110 &lcd, Gamepad &pad); + + int randomMazeIndexGenerator(int mazeIndex); + MazeEngine _engine; - Sound _tune; int _mazeIndex; + + float _FPS; + bool _control; bool _colour; + bool _goal; + bool _tone; };