![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
MenuClasses/Tutorial/Tutorial.h@85:d50ba0994676, 2019-05-06 (annotated)
- Committer:
- AhmedPlaymaker
- Date:
- Mon May 06 23:41:03 2019 +0000
- Revision:
- 85:d50ba0994676
- Parent:
- 83:329da564799a
- Child:
- 90:741120c09784
I Think the tutorial needs no more content work... But i know i cant help but improvise ;)
Who changed what in which revision?
User | Revision | Line number | New 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 | 60:d3a9e0e4a0de | 8 | class Tutorial |
AhmedPlaymaker | 60:d3a9e0e4a0de | 9 | { |
AhmedPlaymaker | 60:d3a9e0e4a0de | 10 | public: |
AhmedPlaymaker | 60:d3a9e0e4a0de | 11 | |
AhmedPlaymaker | 60:d3a9e0e4a0de | 12 | Tutorial(); |
AhmedPlaymaker | 60:d3a9e0e4a0de | 13 | ~Tutorial(); |
AhmedPlaymaker | 60:d3a9e0e4a0de | 14 | |
AhmedPlaymaker | 83:329da564799a | 15 | /** Initialise Tutorial |
AhmedPlaymaker | 83:329da564799a | 16 | * |
AhmedPlaymaker | 83:329da564799a | 17 | * This function passes the pointers to the tutorial class so that it can control the screen and the gamepad. |
AhmedPlaymaker | 83:329da564799a | 18 | */ |
AhmedPlaymaker | 83:329da564799a | 19 | void init(N5110 *lcd, Gamepad *pad); |
AhmedPlaymaker | 83:329da564799a | 20 | |
AhmedPlaymaker | 60:d3a9e0e4a0de | 21 | /** Implement Tutorial |
AhmedPlaymaker | 60:d3a9e0e4a0de | 22 | * |
AhmedPlaymaker | 60:d3a9e0e4a0de | 23 | * This function is used to configure Tutorial. |
AhmedPlaymaker | 60:d3a9e0e4a0de | 24 | */ |
AhmedPlaymaker | 83:329da564799a | 25 | void Implement(); |
AhmedPlaymaker | 60:d3a9e0e4a0de | 26 | |
AhmedPlaymaker | 80:51ca38c5dcdf | 27 | /** Check Back Pressed |
AhmedPlaymaker | 80:51ca38c5dcdf | 28 | * |
AhmedPlaymaker | 80:51ca38c5dcdf | 29 | * This function makes a centralised approach to check when back is pressed in a loop, so that it can be used to exit it and also go to. |
AhmedPlaymaker | 80:51ca38c5dcdf | 30 | * the previous menu option. |
AhmedPlaymaker | 80:51ca38c5dcdf | 31 | */ |
AhmedPlaymaker | 83:329da564799a | 32 | bool checkBackPressed(); |
AhmedPlaymaker | 80:51ca38c5dcdf | 33 | |
AhmedPlaymaker | 60:d3a9e0e4a0de | 34 | /** game Pad |
AhmedPlaymaker | 60:d3a9e0e4a0de | 35 | * |
AhmedPlaymaker | 60:d3a9e0e4a0de | 36 | * This function introduces the gamepad to the user. |
AhmedPlaymaker | 60:d3a9e0e4a0de | 37 | */ |
AhmedPlaymaker | 83:329da564799a | 38 | void gamePad(); |
AhmedPlaymaker | 60:d3a9e0e4a0de | 39 | |
AhmedPlaymaker | 78:10e5cc013806 | 40 | /** settings |
AhmedPlaymaker | 78:10e5cc013806 | 41 | * |
AhmedPlaymaker | 78:10e5cc013806 | 42 | * This function shows how to control parameters in settings. |
AhmedPlaymaker | 78:10e5cc013806 | 43 | */ |
AhmedPlaymaker | 83:329da564799a | 44 | void settings(); |
AhmedPlaymaker | 78:10e5cc013806 | 45 | |
AhmedPlaymaker | 78:10e5cc013806 | 46 | /** Controls To Navigate In Menu |
AhmedPlaymaker | 78:10e5cc013806 | 47 | * |
AhmedPlaymaker | 78:10e5cc013806 | 48 | * This function shows how to scroll through menu. |
AhmedPlaymaker | 78:10e5cc013806 | 49 | */ |
AhmedPlaymaker | 83:329da564799a | 50 | void controlsToNavigateInMenu(); |
AhmedPlaymaker | 78:10e5cc013806 | 51 | |
AhmedPlaymaker | 78:10e5cc013806 | 52 | /** Controls To Navigate through Game Mode and Game Speed. |
AhmedPlaymaker | 78:10e5cc013806 | 53 | * |
AhmedPlaymaker | 78:10e5cc013806 | 54 | * This function shows how to scroll through menu. |
AhmedPlaymaker | 78:10e5cc013806 | 55 | */ |
AhmedPlaymaker | 83:329da564799a | 56 | void controlsToNavigateGameModeSpeed(); |
AhmedPlaymaker | 78:10e5cc013806 | 57 | |
AhmedPlaymaker | 78:10e5cc013806 | 58 | /** Controls To Play Game. |
AhmedPlaymaker | 78:10e5cc013806 | 59 | * |
AhmedPlaymaker | 78:10e5cc013806 | 60 | * This function shows how to move the snake in the game. |
AhmedPlaymaker | 78:10e5cc013806 | 61 | */ |
AhmedPlaymaker | 83:329da564799a | 62 | void controlsToPlayGame(); |
AhmedPlaymaker | 78:10e5cc013806 | 63 | |
AhmedPlaymaker | 85:d50ba0994676 | 64 | /** Controls For Previous Or Next. |
AhmedPlaymaker | 78:10e5cc013806 | 65 | * |
AhmedPlaymaker | 78:10e5cc013806 | 66 | * This function shows how to start/end the game and also go to the next/previous menu. |
AhmedPlaymaker | 78:10e5cc013806 | 67 | */ |
AhmedPlaymaker | 83:329da564799a | 68 | void controlsForPreviousOrNext(); |
AhmedPlaymaker | 80:51ca38c5dcdf | 69 | |
AhmedPlaymaker | 85:d50ba0994676 | 70 | /** Block Tutorial A. |
AhmedPlaymaker | 85:d50ba0994676 | 71 | * |
AhmedPlaymaker | 85:d50ba0994676 | 72 | * This function takes us to tutorial of why to avoid them. |
AhmedPlaymaker | 85:d50ba0994676 | 73 | */ |
AhmedPlaymaker | 85:d50ba0994676 | 74 | void BlockTutorialA(); |
AhmedPlaymaker | 85:d50ba0994676 | 75 | |
AhmedPlaymaker | 85:d50ba0994676 | 76 | /** Block Tutorial B. |
AhmedPlaymaker | 85:d50ba0994676 | 77 | * |
AhmedPlaymaker | 85:d50ba0994676 | 78 | * This function displays to the user what the block does. |
AhmedPlaymaker | 85:d50ba0994676 | 79 | */ |
AhmedPlaymaker | 85:d50ba0994676 | 80 | void BlockTutorialB(); |
AhmedPlaymaker | 85:d50ba0994676 | 81 | |
AhmedPlaymaker | 85:d50ba0994676 | 82 | /** Block Tutorial C. |
AhmedPlaymaker | 85:d50ba0994676 | 83 | * |
AhmedPlaymaker | 85:d50ba0994676 | 84 | * This function displays to the user that they can still slide away after colliding. |
AhmedPlaymaker | 85:d50ba0994676 | 85 | */ |
AhmedPlaymaker | 85:d50ba0994676 | 86 | void BlockTutorialC(); |
AhmedPlaymaker | 85:d50ba0994676 | 87 | |
AhmedPlaymaker | 85:d50ba0994676 | 88 | /** Food Tutorial. |
AhmedPlaymaker | 85:d50ba0994676 | 89 | * |
AhmedPlaymaker | 85:d50ba0994676 | 90 | * This function displays to the user how to react to food in way of our game. |
AhmedPlaymaker | 85:d50ba0994676 | 91 | */ |
AhmedPlaymaker | 85:d50ba0994676 | 92 | void FoodTutorial(); |
AhmedPlaymaker | 85:d50ba0994676 | 93 | |
AhmedPlaymaker | 85:d50ba0994676 | 94 | /** Barrier Tutorial. |
AhmedPlaymaker | 85:d50ba0994676 | 95 | * |
AhmedPlaymaker | 85:d50ba0994676 | 96 | * This function takes us to tutorial of what the barrier does in our game. |
AhmedPlaymaker | 85:d50ba0994676 | 97 | */ |
AhmedPlaymaker | 85:d50ba0994676 | 98 | void BarrierTutorial(); |
AhmedPlaymaker | 85:d50ba0994676 | 99 | |
AhmedPlaymaker | 85:d50ba0994676 | 100 | /** General Information. |
AhmedPlaymaker | 85:d50ba0994676 | 101 | * |
AhmedPlaymaker | 85:d50ba0994676 | 102 | * This function talks us through some general information about the game. |
AhmedPlaymaker | 85:d50ba0994676 | 103 | */ |
AhmedPlaymaker | 85:d50ba0994676 | 104 | void GeneralInfo(); |
AhmedPlaymaker | 85:d50ba0994676 | 105 | |
AhmedPlaymaker | 85:d50ba0994676 | 106 | |
AhmedPlaymaker | 80:51ca38c5dcdf | 107 | private: |
AhmedPlaymaker | 80:51ca38c5dcdf | 108 | bool _backPressed; //remembers if back is pressed. |
AhmedPlaymaker | 80:51ca38c5dcdf | 109 | |
AhmedPlaymaker | 83:329da564799a | 110 | //Pointer to the game pad object pad. |
AhmedPlaymaker | 83:329da564799a | 111 | Gamepad *_pad; |
AhmedPlaymaker | 83:329da564799a | 112 | //Pointer to the N5110 object lcd. |
AhmedPlaymaker | 83:329da564799a | 113 | N5110 *_lcd; |
AhmedPlaymaker | 83:329da564799a | 114 | |
AhmedPlaymaker | 60:d3a9e0e4a0de | 115 | }; |
AhmedPlaymaker | 60:d3a9e0e4a0de | 116 | #endif |