Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Committer:
AhmedPlaymaker
Date:
Wed May 08 21:01:20 2019 +0000
Revision:
90:741120c09784
Parent:
85:d50ba0994676
Child:
91:ca8cff78f2fe
Made documentation for stats and tutorial.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AhmedPlaymaker 60:d3a9e0e4a0de 1 #ifndef TUTORIAL_H
AhmedPlaymaker 60:d3a9e0e4a0de 2 #define TUTORIAL_H
AhmedPlaymaker 60:d3a9e0e4a0de 3
AhmedPlaymaker 60:d3a9e0e4a0de 4 #include "mbed.h"
AhmedPlaymaker 60:d3a9e0e4a0de 5 #include "N5110.h"
AhmedPlaymaker 60:d3a9e0e4a0de 6 #include "Gamepad.h"
AhmedPlaymaker 60:d3a9e0e4a0de 7
AhmedPlaymaker 90:741120c09784 8 /** Tutorial Class
AhmedPlaymaker 90:741120c09784 9 @brief Class for allowing the user to know more about the game using sprites, texts and interactive controls..
AhmedPlaymaker 90:741120c09784 10 @author Ahmed N.Adamjee
AhmedPlaymaker 90:741120c09784 11 @date 8th May 2019
AhmedPlaymaker 90:741120c09784 12 */
AhmedPlaymaker 60:d3a9e0e4a0de 13 class Tutorial
AhmedPlaymaker 60:d3a9e0e4a0de 14 {
AhmedPlaymaker 60:d3a9e0e4a0de 15 public:
AhmedPlaymaker 90:741120c09784 16
AhmedPlaymaker 90:741120c09784 17 /** Constructor */
AhmedPlaymaker 60:d3a9e0e4a0de 18 Tutorial();
AhmedPlaymaker 90:741120c09784 19 /** Destructor */
AhmedPlaymaker 60:d3a9e0e4a0de 20 ~Tutorial();
AhmedPlaymaker 60:d3a9e0e4a0de 21
AhmedPlaymaker 90:741120c09784 22 /** Gets pointers of lcd and pad from int main() to be used privately in the entire class.
AhmedPlaymaker 90:741120c09784 23 * @param pointer to the N5110 object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function.
AhmedPlaymaker 90:741120c09784 24 * @param pointer to the gamepad object in main, address of this pointer is saved to make availability to the entire class, without passing address to each function.
AhmedPlaymaker 83:329da564799a 25 */
AhmedPlaymaker 83:329da564799a 26 void init(N5110 *lcd, Gamepad *pad);
AhmedPlaymaker 83:329da564799a 27
AhmedPlaymaker 90:741120c09784 28 /** Used to call all Tutorial functions and go forth and exit the tutorial functions.*/
AhmedPlaymaker 83:329da564799a 29 void Implement();
AhmedPlaymaker 90:741120c09784 30
AhmedPlaymaker 90:741120c09784 31 /** Checks BACK if button pressed in a loop, can be used to exit it and also remember if true/false and used for various conditions.
AhmedPlaymaker 90:741120c09784 32 * @return True if the BACK pressed, else False.
AhmedPlaymaker 80:51ca38c5dcdf 33 */
AhmedPlaymaker 83:329da564799a 34 bool checkBackPressed();
AhmedPlaymaker 80:51ca38c5dcdf 35
AhmedPlaymaker 90:741120c09784 36 /** Introduces how to use the gamepad to the user for this tutorial.*/
AhmedPlaymaker 83:329da564799a 37 void gamePad();
AhmedPlaymaker 60:d3a9e0e4a0de 38
AhmedPlaymaker 90:741120c09784 39 /** Shows how to control parameters in settings.*/
AhmedPlaymaker 83:329da564799a 40 void settings();
AhmedPlaymaker 78:10e5cc013806 41
AhmedPlaymaker 90:741120c09784 42 /** Shows how to scroll through menu.*/
AhmedPlaymaker 83:329da564799a 43 void controlsToNavigateInMenu();
AhmedPlaymaker 78:10e5cc013806 44
AhmedPlaymaker 90:741120c09784 45 /** Shows how to scroll through Game Mode and Game Speed Menus.*/
AhmedPlaymaker 83:329da564799a 46 void controlsToNavigateGameModeSpeed();
AhmedPlaymaker 78:10e5cc013806 47
AhmedPlaymaker 90:741120c09784 48 /** Shows how to move the snake in the game.*/
AhmedPlaymaker 83:329da564799a 49 void controlsToPlayGame();
AhmedPlaymaker 78:10e5cc013806 50
AhmedPlaymaker 90:741120c09784 51 /** Shows how to start/end the game and also go to the next/previous menu.*/
AhmedPlaymaker 83:329da564799a 52 void controlsForPreviousOrNext();
AhmedPlaymaker 80:51ca38c5dcdf 53
AhmedPlaymaker 90:741120c09784 54 /** Takes us to tutorial of why to avoid the blocks.*/
AhmedPlaymaker 85:d50ba0994676 55 void BlockTutorialA();
AhmedPlaymaker 85:d50ba0994676 56
AhmedPlaymaker 90:741120c09784 57 /** Explains to the user what the block does.*/
AhmedPlaymaker 85:d50ba0994676 58 void BlockTutorialB();
AhmedPlaymaker 85:d50ba0994676 59
AhmedPlaymaker 90:741120c09784 60 /** Conveys to the user that they can still slide away after colliding.*/
AhmedPlaymaker 85:d50ba0994676 61 void BlockTutorialC();
AhmedPlaymaker 85:d50ba0994676 62
AhmedPlaymaker 90:741120c09784 63 /** Displays to the user how to react to food in way of our game.*/
AhmedPlaymaker 85:d50ba0994676 64 void FoodTutorial();
AhmedPlaymaker 85:d50ba0994676 65
AhmedPlaymaker 90:741120c09784 66 /** Takes us to tutorial of what the barrier does in our game.*/
AhmedPlaymaker 85:d50ba0994676 67 void BarrierTutorial();
AhmedPlaymaker 85:d50ba0994676 68
AhmedPlaymaker 90:741120c09784 69 /** Talks us through some general information about the game.*/
AhmedPlaymaker 85:d50ba0994676 70 void GeneralInfo();
AhmedPlaymaker 85:d50ba0994676 71
AhmedPlaymaker 85:d50ba0994676 72
AhmedPlaymaker 80:51ca38c5dcdf 73 private:
AhmedPlaymaker 80:51ca38c5dcdf 74 bool _backPressed; //remembers if back is pressed.
AhmedPlaymaker 80:51ca38c5dcdf 75
AhmedPlaymaker 83:329da564799a 76 //Pointer to the game pad object pad.
AhmedPlaymaker 83:329da564799a 77 Gamepad *_pad;
AhmedPlaymaker 83:329da564799a 78 //Pointer to the N5110 object lcd.
AhmedPlaymaker 83:329da564799a 79 N5110 *_lcd;
AhmedPlaymaker 83:329da564799a 80
AhmedPlaymaker 60:d3a9e0e4a0de 81 };
AhmedPlaymaker 60:d3a9e0e4a0de 82 #endif