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.
Menu.h@3:a79daa7c2b55, 2017-04-16 (annotated)
- Committer:
- el15mh
- Date:
- Sun Apr 16 12:31:48 2017 +0000
- Revision:
- 3:a79daa7c2b55
- Parent:
- 2:917211a4551b
- Child:
- 4:4f20bcef2c0c
game with completed mazes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el15mh | 0:b32f6570a26d | 1 | /* |
el15mh | 1:21b7a5edb9c2 | 2 | |
el15mh | 1:21b7a5edb9c2 | 3 | @file Menu.h |
el15mh | 1:21b7a5edb9c2 | 4 | |
el15mh | 1:21b7a5edb9c2 | 5 | (c) Max Houghton 02.14.17 |
el15mh | 1:21b7a5edb9c2 | 6 | Roller Maze Project, ELEC2645, Univeristy of Leeds |
el15mh | 1:21b7a5edb9c2 | 7 | |
el15mh | 1:21b7a5edb9c2 | 8 | */ |
el15mh | 0:b32f6570a26d | 9 | |
el15mh | 0:b32f6570a26d | 10 | #ifndef MENU_H |
el15mh | 0:b32f6570a26d | 11 | #define MENU_H |
el15mh | 0:b32f6570a26d | 12 | |
el15mh | 0:b32f6570a26d | 13 | #include "mbed.h" |
el15mh | 0:b32f6570a26d | 14 | #include "N5110.h" |
el15mh | 0:b32f6570a26d | 15 | #include "Gamepad.h" |
el15mh | 2:917211a4551b | 16 | #include "MazeEngine.h" |
el15mh | 3:a79daa7c2b55 | 17 | #include "Animations.h" |
el15mh | 2:917211a4551b | 18 | #include "Maze.h" |
el15mh | 2:917211a4551b | 19 | #include "Ball.h" |
el15mh | 3:a79daa7c2b55 | 20 | #include "Sound.h" |
el15mh | 0:b32f6570a26d | 21 | |
el15mh | 0:b32f6570a26d | 22 | class Menu |
el15mh | 0:b32f6570a26d | 23 | { |
el15mh | 2:917211a4551b | 24 | |
el15mh | 0:b32f6570a26d | 25 | public: |
el15mh | 0:b32f6570a26d | 26 | |
el15mh | 0:b32f6570a26d | 27 | Menu(); |
el15mh | 0:b32f6570a26d | 28 | ~Menu(); |
el15mh | 0:b32f6570a26d | 29 | |
el15mh | 3:a79daa7c2b55 | 30 | void init(); |
el15mh | 3:a79daa7c2b55 | 31 | void main(N5110 &lcd, Gamepad &pad, FXOS8700CQ &device, Sound &tune, Animations &animate); |
el15mh | 3:a79daa7c2b55 | 32 | void intro(N5110 &lcd, Gamepad &pad, Sound &tune, Animations &animate); |
el15mh | 3:a79daa7c2b55 | 33 | void playGame(N5110 &lcd, Gamepad &pad, FXOS8700CQ &device, Sound &tune, int mazeIndex); |
el15mh | 3:a79daa7c2b55 | 34 | void options(N5110 &lcd, Gamepad &pad, Animations &animate); |
el15mh | 1:21b7a5edb9c2 | 35 | void lcdSettings(N5110 &lcd, Gamepad &pad); |
el15mh | 1:21b7a5edb9c2 | 36 | void soundSettings(N5110 &lcd, Gamepad &pad); |
el15mh | 3:a79daa7c2b55 | 37 | void controlOptions(N5110 &lcd, Gamepad &pad, Animations &animate); |
el15mh | 1:21b7a5edb9c2 | 38 | void difficultyOptions(N5110 &lcd, Gamepad &pad); |
el15mh | 1:21b7a5edb9c2 | 39 | void lcdColourOptions(N5110 &lcd, Gamepad &pad); |
el15mh | 1:21b7a5edb9c2 | 40 | void lcdInverseColour(N5110 &lcd, Gamepad &pad); |
el15mh | 1:21b7a5edb9c2 | 41 | void lcdBackgroundColour(N5110 &lcd, Gamepad &pad); |
el15mh | 3:a79daa7c2b55 | 42 | void animateJoystick(N5110 &lcd, Gamepad &pad, Animations &animate); |
el15mh | 3:a79daa7c2b55 | 43 | void animateGamepad(N5110 &lcd, Gamepad &pad, Animations &animate); |
el15mh | 3:a79daa7c2b55 | 44 | void soundEffects(N5110 &lcd, Gamepad &pad); |
el15mh | 3:a79daa7c2b55 | 45 | void musicSettings(N5110 &lcd, Gamepad &pad); |
el15mh | 0:b32f6570a26d | 46 | |
el15mh | 0:b32f6570a26d | 47 | private: |
el15mh | 2:917211a4551b | 48 | |
el15mh | 2:917211a4551b | 49 | MazeEngine _engine; |
el15mh | 3:a79daa7c2b55 | 50 | Sound _tune; |
el15mh | 2:917211a4551b | 51 | |
el15mh | 2:917211a4551b | 52 | int _mazeIndex; |
el15mh | 3:a79daa7c2b55 | 53 | bool _control; |
el15mh | 3:a79daa7c2b55 | 54 | bool _colour; |
el15mh | 2:917211a4551b | 55 | |
el15mh | 0:b32f6570a26d | 56 | }; |
el15mh | 0:b32f6570a26d | 57 | |
el15mh | 2:917211a4551b | 58 | #endif /* MENU_H */ |