![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
MenuClasses/Tutorial/Tutorial.h@80:51ca38c5dcdf, 2019-05-06 (annotated)
- Committer:
- AhmedPlaymaker
- Date:
- Mon May 06 08:00:56 2019 +0000
- Revision:
- 80:51ca38c5dcdf
- Parent:
- 78:10e5cc013806
- Child:
- 83:329da564799a
Implemented back functionality in tutorials.
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 | 60:d3a9e0e4a0de | 15 | /** Implement Tutorial |
AhmedPlaymaker | 60:d3a9e0e4a0de | 16 | * |
AhmedPlaymaker | 60:d3a9e0e4a0de | 17 | * This function is used to configure Tutorial. |
AhmedPlaymaker | 60:d3a9e0e4a0de | 18 | */ |
AhmedPlaymaker | 60:d3a9e0e4a0de | 19 | void Implement(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 60:d3a9e0e4a0de | 20 | |
AhmedPlaymaker | 80:51ca38c5dcdf | 21 | /** Check Back Pressed |
AhmedPlaymaker | 80:51ca38c5dcdf | 22 | * |
AhmedPlaymaker | 80:51ca38c5dcdf | 23 | * 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 | 24 | * the previous menu option. |
AhmedPlaymaker | 80:51ca38c5dcdf | 25 | */ |
AhmedPlaymaker | 80:51ca38c5dcdf | 26 | bool checkBackPressed(Gamepad &pad); |
AhmedPlaymaker | 80:51ca38c5dcdf | 27 | |
AhmedPlaymaker | 60:d3a9e0e4a0de | 28 | /** game Pad |
AhmedPlaymaker | 60:d3a9e0e4a0de | 29 | * |
AhmedPlaymaker | 60:d3a9e0e4a0de | 30 | * This function introduces the gamepad to the user. |
AhmedPlaymaker | 60:d3a9e0e4a0de | 31 | */ |
AhmedPlaymaker | 60:d3a9e0e4a0de | 32 | void gamePad(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 60:d3a9e0e4a0de | 33 | |
AhmedPlaymaker | 78:10e5cc013806 | 34 | /** settings |
AhmedPlaymaker | 78:10e5cc013806 | 35 | * |
AhmedPlaymaker | 78:10e5cc013806 | 36 | * This function shows how to control parameters in settings. |
AhmedPlaymaker | 78:10e5cc013806 | 37 | */ |
AhmedPlaymaker | 78:10e5cc013806 | 38 | void settings(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 78:10e5cc013806 | 39 | |
AhmedPlaymaker | 78:10e5cc013806 | 40 | /** Controls To Navigate In Menu |
AhmedPlaymaker | 78:10e5cc013806 | 41 | * |
AhmedPlaymaker | 78:10e5cc013806 | 42 | * This function shows how to scroll through menu. |
AhmedPlaymaker | 78:10e5cc013806 | 43 | */ |
AhmedPlaymaker | 78:10e5cc013806 | 44 | void controlsToNavigateInMenu(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 78:10e5cc013806 | 45 | |
AhmedPlaymaker | 78:10e5cc013806 | 46 | /** Controls To Navigate through Game Mode and Game Speed. |
AhmedPlaymaker | 78:10e5cc013806 | 47 | * |
AhmedPlaymaker | 78:10e5cc013806 | 48 | * This function shows how to scroll through menu. |
AhmedPlaymaker | 78:10e5cc013806 | 49 | */ |
AhmedPlaymaker | 78:10e5cc013806 | 50 | void controlsToNavigateGameModeSpeed(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 78:10e5cc013806 | 51 | |
AhmedPlaymaker | 78:10e5cc013806 | 52 | /** Controls To Play Game. |
AhmedPlaymaker | 78:10e5cc013806 | 53 | * |
AhmedPlaymaker | 78:10e5cc013806 | 54 | * This function shows how to move the snake in the game. |
AhmedPlaymaker | 78:10e5cc013806 | 55 | */ |
AhmedPlaymaker | 78:10e5cc013806 | 56 | void controlsToPlayGame(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 78:10e5cc013806 | 57 | |
AhmedPlaymaker | 78:10e5cc013806 | 58 | /** ControlsvForvPreviousvOr Next. |
AhmedPlaymaker | 78:10e5cc013806 | 59 | * |
AhmedPlaymaker | 78:10e5cc013806 | 60 | * This function shows how to start/end the game and also go to the next/previous menu. |
AhmedPlaymaker | 78:10e5cc013806 | 61 | */ |
AhmedPlaymaker | 78:10e5cc013806 | 62 | void controlsForPreviousOrNext(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 80:51ca38c5dcdf | 63 | |
AhmedPlaymaker | 80:51ca38c5dcdf | 64 | private: |
AhmedPlaymaker | 80:51ca38c5dcdf | 65 | bool _backPressed; //remembers if back is pressed. |
AhmedPlaymaker | 80:51ca38c5dcdf | 66 | |
AhmedPlaymaker | 60:d3a9e0e4a0de | 67 | }; |
AhmedPlaymaker | 60:d3a9e0e4a0de | 68 | #endif |