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.

Committer:
el15mh
Date:
Wed May 03 21:13:31 2017 +0000
Revision:
5:56f13954666e
Parent:
4:4f20bcef2c0c
Child:
6:2a05dd8b9750
fully working program

Who changed what in which revision?

UserRevisionLine numberNew 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 4:4f20bcef2c0c 13 #include <stdlib.h> // used to generate random number values
el15mh 4:4f20bcef2c0c 14
el15mh 0:b32f6570a26d 15 #include "mbed.h"
el15mh 0:b32f6570a26d 16 #include "N5110.h"
el15mh 0:b32f6570a26d 17 #include "Gamepad.h"
el15mh 2:917211a4551b 18 #include "MazeEngine.h"
el15mh 3:a79daa7c2b55 19 #include "Animations.h"
el15mh 2:917211a4551b 20 #include "Maze.h"
el15mh 2:917211a4551b 21 #include "Ball.h"
el15mh 0:b32f6570a26d 22
el15mh 5:56f13954666e 23 #define G 196.00
el15mh 5:56f13954666e 24 #define C
el15mh 5:56f13954666e 25
el15mh 0:b32f6570a26d 26 class Menu
el15mh 0:b32f6570a26d 27 {
el15mh 2:917211a4551b 28
el15mh 0:b32f6570a26d 29 public:
el15mh 0:b32f6570a26d 30
el15mh 0:b32f6570a26d 31 Menu();
el15mh 0:b32f6570a26d 32 ~Menu();
el15mh 0:b32f6570a26d 33
el15mh 3:a79daa7c2b55 34 void init();
el15mh 4:4f20bcef2c0c 35 void main(N5110 &lcd,
el15mh 4:4f20bcef2c0c 36 Gamepad &pad,
el15mh 4:4f20bcef2c0c 37 FXOS8700CQ &device,
el15mh 4:4f20bcef2c0c 38 Animations &animate);
el15mh 4:4f20bcef2c0c 39
el15mh 4:4f20bcef2c0c 40 void intro(N5110 &lcd, Gamepad &pad, Animations &animate);
el15mh 0:b32f6570a26d 41
el15mh 0:b32f6570a26d 42 private:
el15mh 2:917211a4551b 43
el15mh 4:4f20bcef2c0c 44 void printGameParameters(int mazeIndex,
el15mh 4:4f20bcef2c0c 45 int x,
el15mh 4:4f20bcef2c0c 46 int y,
el15mh 4:4f20bcef2c0c 47 int radius,
el15mh 4:4f20bcef2c0c 48 bool control,
el15mh 4:4f20bcef2c0c 49 bool colour,
el15mh 4:4f20bcef2c0c 50 float FPS);
el15mh 4:4f20bcef2c0c 51
el15mh 4:4f20bcef2c0c 52 void playGame(N5110 &lcd,
el15mh 4:4f20bcef2c0c 53 Gamepad &pad,
el15mh 4:4f20bcef2c0c 54 FXOS8700CQ &device,
el15mh 4:4f20bcef2c0c 55 Animations &animate,
el15mh 4:4f20bcef2c0c 56 int mazeIndex,
el15mh 4:4f20bcef2c0c 57 bool tone,
el15mh 4:4f20bcef2c0c 58 float FPS);
el15mh 4:4f20bcef2c0c 59
el15mh 4:4f20bcef2c0c 60 void options(N5110 &lcd, Gamepad &pad, Animations &animate, bool tone);
el15mh 4:4f20bcef2c0c 61 void lcdSettings(N5110 &lcd, Gamepad &pad, Animations &animate);
el15mh 4:4f20bcef2c0c 62 void soundSettings(N5110 &lcd, Gamepad &pad, Animations &animate);
el15mh 4:4f20bcef2c0c 63 void controlOptions(N5110 &lcd, Gamepad &pad, Animations &animate);
el15mh 4:4f20bcef2c0c 64 void difficultyOptions(N5110 &lcd, Gamepad &pad);
el15mh 4:4f20bcef2c0c 65 void ballColourOptions(N5110 &lcd, Gamepad &pad, Animations &animate);
el15mh 4:4f20bcef2c0c 66 void lcdInverseColour(N5110 &lcd, Gamepad &pad);
el15mh 4:4f20bcef2c0c 67 void lcdBackgroundColour(N5110 &lcd, Gamepad &pad, Animations &animate);
el15mh 4:4f20bcef2c0c 68
el15mh 4:4f20bcef2c0c 69 void animateJoystick(N5110 &lcd, Animations &animate);
el15mh 4:4f20bcef2c0c 70 void animateGamepad(N5110 &lcd, Animations &animate);
el15mh 4:4f20bcef2c0c 71 void animateStickman(N5110 &lcd, Gamepad &pad, Animations &animate);
el15mh 4:4f20bcef2c0c 72
el15mh 4:4f20bcef2c0c 73 void soundEffects(N5110 &lcd, Gamepad &pad, Animations &animate);
el15mh 4:4f20bcef2c0c 74 void speedSettings(N5110 &lcd, Gamepad &pad);
el15mh 4:4f20bcef2c0c 75
el15mh 5:56f13954666e 76 int randomMazeIndexGenerator(int difficulty);
el15mh 5:56f13954666e 77
el15mh 2:917211a4551b 78 MazeEngine _engine;
el15mh 2:917211a4551b 79
el15mh 2:917211a4551b 80 int _mazeIndex;
el15mh 5:56f13954666e 81 int _difficulty;
el15mh 4:4f20bcef2c0c 82
el15mh 4:4f20bcef2c0c 83 float _FPS;
el15mh 4:4f20bcef2c0c 84
el15mh 3:a79daa7c2b55 85 bool _control;
el15mh 3:a79daa7c2b55 86 bool _colour;
el15mh 4:4f20bcef2c0c 87 bool _goal;
el15mh 4:4f20bcef2c0c 88 bool _tone;
el15mh 2:917211a4551b 89
el15mh 0:b32f6570a26d 90 };
el15mh 0:b32f6570a26d 91
el15mh 2:917211a4551b 92 #endif /* MENU_H */