![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
StartScreen/StartScreen.h@30:461231877c89, 2019-04-15 (annotated)
- Committer:
- AhmedPlaymaker
- Date:
- Mon Apr 15 06:00:01 2019 +0000
- Revision:
- 30:461231877c89
- Parent:
- 16:7b474f873683
- Child:
- 33:249cf423fb18
Removed glitches of the pad remembering the buttons pressed too long.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AhmedPlaymaker | 3:fbb1fa853f09 | 1 | #ifndef StartScreen_H |
AhmedPlaymaker | 3:fbb1fa853f09 | 2 | #define StartScreen_H |
AhmedPlaymaker | 3:fbb1fa853f09 | 3 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 4 | #include "mbed.h" |
AhmedPlaymaker | 3:fbb1fa853f09 | 5 | #include "N5110.h" |
AhmedPlaymaker | 3:fbb1fa853f09 | 6 | #include "Gamepad.h" |
AhmedPlaymaker | 5:e4df87957a5b | 7 | #include "Settings.h" |
AhmedPlaymaker | 3:fbb1fa853f09 | 8 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 9 | class StartScreen |
AhmedPlaymaker | 3:fbb1fa853f09 | 10 | { |
AhmedPlaymaker | 3:fbb1fa853f09 | 11 | public: |
AhmedPlaymaker | 3:fbb1fa853f09 | 12 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 13 | StartScreen(); |
AhmedPlaymaker | 30:461231877c89 | 14 | ~StartScreen() |
AhmedPlaymaker | 30:461231877c89 | 15 | ; |
AhmedPlaymaker | 30:461231877c89 | 16 | void init(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 17 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 18 | /** Initialise StartScreen |
AhmedPlaymaker | 3:fbb1fa853f09 | 19 | * |
AhmedPlaymaker | 3:fbb1fa853f09 | 20 | * This function initialises the Game Interface and restarts the display. |
AhmedPlaymaker | 3:fbb1fa853f09 | 21 | */ |
AhmedPlaymaker | 3:fbb1fa853f09 | 22 | void screen_saver(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 3:fbb1fa853f09 | 23 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 24 | /** Draw |
AhmedPlaymaker | 3:fbb1fa853f09 | 25 | * |
AhmedPlaymaker | 3:fbb1fa853f09 | 26 | * This function draws the Sprite onto the screen. |
AhmedPlaymaker | 3:fbb1fa853f09 | 27 | */ |
AhmedPlaymaker | 3:fbb1fa853f09 | 28 | void instruct(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 3:fbb1fa853f09 | 29 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 30 | /** Instruct |
AhmedPlaymaker | 3:fbb1fa853f09 | 31 | * |
AhmedPlaymaker | 3:fbb1fa853f09 | 32 | * This function updates the user about how to progress after the game banner has been displayed.. |
AhmedPlaymaker | 3:fbb1fa853f09 | 33 | */ |
AhmedPlaymaker | 3:fbb1fa853f09 | 34 | void info(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 3:fbb1fa853f09 | 35 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 36 | /** Display userID |
AhmedPlaymaker | 3:fbb1fa853f09 | 37 | * |
AhmedPlaymaker | 3:fbb1fa853f09 | 38 | * This function shows who the author of the game is before showing the menu screen. |
AhmedPlaymaker | 3:fbb1fa853f09 | 39 | */ |
AhmedPlaymaker | 3:fbb1fa853f09 | 40 | void menu_screen1(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 3:fbb1fa853f09 | 41 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 42 | /** The First Menu Screen |
AhmedPlaymaker | 3:fbb1fa853f09 | 43 | * |
AhmedPlaymaker | 3:fbb1fa853f09 | 44 | * This function obtains the user input on how they want to progress. |
AhmedPlaymaker | 3:fbb1fa853f09 | 45 | */ |
AhmedPlaymaker | 4:1fe015b66bb8 | 46 | |
AhmedPlaymaker | 30:461231877c89 | 47 | void DisplaySc1Contents(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 30:461231877c89 | 48 | |
AhmedPlaymaker | 30:461231877c89 | 49 | /** Displaying The First Menu Screen |
AhmedPlaymaker | 30:461231877c89 | 50 | * |
AhmedPlaymaker | 30:461231877c89 | 51 | * This function just displays Menu Screen 1 contents. |
AhmedPlaymaker | 30:461231877c89 | 52 | */ |
AhmedPlaymaker | 30:461231877c89 | 53 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 54 | void menu_screen2(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 55 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 56 | /** The Second Menu Screen |
AhmedPlaymaker | 4:1fe015b66bb8 | 57 | * |
AhmedPlaymaker | 4:1fe015b66bb8 | 58 | * This function obtains the user input on the game type they would like to play. |
AhmedPlaymaker | 4:1fe015b66bb8 | 59 | */ |
AhmedPlaymaker | 4:1fe015b66bb8 | 60 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 61 | void menu_screen3(N5110 &lcd, Gamepad &pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 62 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 63 | /** The Third Menu Screen |
AhmedPlaymaker | 4:1fe015b66bb8 | 64 | * |
AhmedPlaymaker | 4:1fe015b66bb8 | 65 | * This function obtains the user input on the game speed that suits them. |
AhmedPlaymaker | 4:1fe015b66bb8 | 66 | */ |
AhmedPlaymaker | 16:7b474f873683 | 67 | |
AhmedPlaymaker | 16:7b474f873683 | 68 | int fps; // this sends over the game speed |
AhmedPlaymaker | 30:461231877c89 | 69 | int i; |
AhmedPlaymaker | 30:461231877c89 | 70 | int lr; |
AhmedPlaymaker | 30:461231877c89 | 71 | int gs; |
AhmedPlaymaker | 30:461231877c89 | 72 | int st; |
AhmedPlaymaker | 30:461231877c89 | 73 | int sc; |
AhmedPlaymaker | 30:461231877c89 | 74 | float cs; |
AhmedPlaymaker | 3:fbb1fa853f09 | 75 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 76 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 77 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 78 | }; |
AhmedPlaymaker | 3:fbb1fa853f09 | 79 | #endif |