Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Committer:
AhmedPlaymaker
Date:
Wed May 08 21:29:06 2019 +0000
Revision:
91:ca8cff78f2fe
Parent:
90:741120c09784
fixed an error with my documentation syntax

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 91:ca8cff78f2fe 22 /**
AhmedPlaymaker 91:ca8cff78f2fe 23 * @brief Gets pointers of lcd and pad from int main() to be used privately in the entire class.
AhmedPlaymaker 91:ca8cff78f2fe 24 * @param N5110 *lcd @details 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 91:ca8cff78f2fe 25 * @param Gamepad *pad @details 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 26 */
AhmedPlaymaker 83:329da564799a 27 void init(N5110 *lcd, Gamepad *pad);
AhmedPlaymaker 83:329da564799a 28
AhmedPlaymaker 91:ca8cff78f2fe 29 /**
AhmedPlaymaker 91:ca8cff78f2fe 30 * @brief Used to call all Tutorial functions and go forth and exit the tutorial functions.
AhmedPlaymaker 91:ca8cff78f2fe 31 */
AhmedPlaymaker 83:329da564799a 32 void Implement();
AhmedPlaymaker 90:741120c09784 33
AhmedPlaymaker 91:ca8cff78f2fe 34 /**
AhmedPlaymaker 91:ca8cff78f2fe 35 * @brief 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 91:ca8cff78f2fe 36 * @returns _backPressed @details True if the BACK pressed, else False.
AhmedPlaymaker 80:51ca38c5dcdf 37 */
AhmedPlaymaker 83:329da564799a 38 bool checkBackPressed();
AhmedPlaymaker 80:51ca38c5dcdf 39
AhmedPlaymaker 91:ca8cff78f2fe 40 /**
AhmedPlaymaker 91:ca8cff78f2fe 41 * @brief Introduces how to use the gamepad to the user for this tutorial.
AhmedPlaymaker 91:ca8cff78f2fe 42 */
AhmedPlaymaker 83:329da564799a 43 void gamePad();
AhmedPlaymaker 60:d3a9e0e4a0de 44
AhmedPlaymaker 91:ca8cff78f2fe 45 /**
AhmedPlaymaker 91:ca8cff78f2fe 46 * @brief Shows how to control parameters in settings.
AhmedPlaymaker 91:ca8cff78f2fe 47 */
AhmedPlaymaker 83:329da564799a 48 void settings();
AhmedPlaymaker 78:10e5cc013806 49
AhmedPlaymaker 91:ca8cff78f2fe 50 /**
AhmedPlaymaker 91:ca8cff78f2fe 51 * @brief Shows how to scroll through menu.
AhmedPlaymaker 91:ca8cff78f2fe 52 */
AhmedPlaymaker 83:329da564799a 53 void controlsToNavigateInMenu();
AhmedPlaymaker 78:10e5cc013806 54
AhmedPlaymaker 91:ca8cff78f2fe 55 /**
AhmedPlaymaker 91:ca8cff78f2fe 56 * @brief Shows how to scroll through Game Mode and Game Speed Menus.
AhmedPlaymaker 91:ca8cff78f2fe 57 */
AhmedPlaymaker 83:329da564799a 58 void controlsToNavigateGameModeSpeed();
AhmedPlaymaker 78:10e5cc013806 59
AhmedPlaymaker 91:ca8cff78f2fe 60 /**
AhmedPlaymaker 91:ca8cff78f2fe 61 * @brief Shows how to move the snake in the game.
AhmedPlaymaker 91:ca8cff78f2fe 62 */
AhmedPlaymaker 83:329da564799a 63 void controlsToPlayGame();
AhmedPlaymaker 78:10e5cc013806 64
AhmedPlaymaker 90:741120c09784 65 /** Shows how to start/end the game and also go to the next/previous menu.*/
AhmedPlaymaker 83:329da564799a 66 void controlsForPreviousOrNext();
AhmedPlaymaker 80:51ca38c5dcdf 67
AhmedPlaymaker 91:ca8cff78f2fe 68 /**
AhmedPlaymaker 91:ca8cff78f2fe 69 * @brief Takes us to tutorial of why to avoid the blocks.
AhmedPlaymaker 91:ca8cff78f2fe 70 */
AhmedPlaymaker 85:d50ba0994676 71 void BlockTutorialA();
AhmedPlaymaker 85:d50ba0994676 72
AhmedPlaymaker 91:ca8cff78f2fe 73 /**
AhmedPlaymaker 91:ca8cff78f2fe 74 * @brief Explains to the user what the block does.
AhmedPlaymaker 91:ca8cff78f2fe 75 */
AhmedPlaymaker 85:d50ba0994676 76 void BlockTutorialB();
AhmedPlaymaker 85:d50ba0994676 77
AhmedPlaymaker 91:ca8cff78f2fe 78 /**
AhmedPlaymaker 91:ca8cff78f2fe 79 * @brief Conveys to the user that they can still slide away after colliding.
AhmedPlaymaker 91:ca8cff78f2fe 80 */
AhmedPlaymaker 85:d50ba0994676 81 void BlockTutorialC();
AhmedPlaymaker 85:d50ba0994676 82
AhmedPlaymaker 91:ca8cff78f2fe 83 /**
AhmedPlaymaker 91:ca8cff78f2fe 84 * @brief Displays to the user how to react to food in way of our game.
AhmedPlaymaker 91:ca8cff78f2fe 85 */
AhmedPlaymaker 85:d50ba0994676 86 void FoodTutorial();
AhmedPlaymaker 85:d50ba0994676 87
AhmedPlaymaker 91:ca8cff78f2fe 88 /**
AhmedPlaymaker 91:ca8cff78f2fe 89 * @brief Takes us to tutorial of what the barrier does in our game.
AhmedPlaymaker 91:ca8cff78f2fe 90 */
AhmedPlaymaker 85:d50ba0994676 91 void BarrierTutorial();
AhmedPlaymaker 85:d50ba0994676 92
AhmedPlaymaker 91:ca8cff78f2fe 93 /**
AhmedPlaymaker 91:ca8cff78f2fe 94 * @brief Talks us through some general information about the game.
AhmedPlaymaker 91:ca8cff78f2fe 95 */
AhmedPlaymaker 85:d50ba0994676 96 void GeneralInfo();
AhmedPlaymaker 85:d50ba0994676 97
AhmedPlaymaker 85:d50ba0994676 98
AhmedPlaymaker 80:51ca38c5dcdf 99 private:
AhmedPlaymaker 80:51ca38c5dcdf 100 bool _backPressed; //remembers if back is pressed.
AhmedPlaymaker 80:51ca38c5dcdf 101
AhmedPlaymaker 83:329da564799a 102 //Pointer to the game pad object pad.
AhmedPlaymaker 83:329da564799a 103 Gamepad *_pad;
AhmedPlaymaker 83:329da564799a 104 //Pointer to the N5110 object lcd.
AhmedPlaymaker 83:329da564799a 105 N5110 *_lcd;
AhmedPlaymaker 83:329da564799a 106
AhmedPlaymaker 60:d3a9e0e4a0de 107 };
AhmedPlaymaker 60:d3a9e0e4a0de 108 #endif