Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
StartScreen/StartScreen.cpp@19:05cc9f801468, 2019-04-08 (annotated)
- Committer:
- AhmedPlaymaker
- Date:
- Mon Apr 08 16:46:14 2019 +0000
- Revision:
- 19:05cc9f801468
- Parent:
- 18:b391caa5754c
- Child:
- 21:e41126528cc6
made progressive levels slightly more difficult, will test on people later, have to print levels on screen after each progressive level.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AhmedPlaymaker | 3:fbb1fa853f09 | 1 | #include "StartScreen.h" |
AhmedPlaymaker | 5:e4df87957a5b | 2 | Settings settings; |
AhmedPlaymaker | 3:fbb1fa853f09 | 3 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 4 | int sprite[48][84] = { |
AhmedPlaymaker | 6:3ffab44ed49c | 5 | {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, |
AhmedPlaymaker | 6:3ffab44ed49c | 6 | {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, |
AhmedPlaymaker | 6:3ffab44ed49c | 7 | {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, |
AhmedPlaymaker | 6:3ffab44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6:3ffab44ed49c | 49 | {1,0,0,0,0,1,1,1,1,1,0,0,1,1,0,0,1,1,0,1,1,0,0,0,1,1,0,1,1,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,0,0,1}, |
AhmedPlaymaker | 6:3ffab44ed49c | 50 | {1,0,0,0,0,0,1,1,1,0,0,0,1,1,0,0,0,1,0,1,1,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,1,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,1,0,1}, |
AhmedPlaymaker | 6:3ffab44ed49c | 51 | {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, |
AhmedPlaymaker | 6:3ffab44ed49c | 52 | {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, |
AhmedPlaymaker | 3:fbb1fa853f09 | 53 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 54 | }; |
AhmedPlaymaker | 3:fbb1fa853f09 | 55 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 56 | int arrow[7][9] = { |
AhmedPlaymaker | 3:fbb1fa853f09 | 57 | {0,0,0,0,1,0,0,0,0}, |
AhmedPlaymaker | 3:fbb1fa853f09 | 58 | {0,0,0,1,1,0,0,0,0}, |
AhmedPlaymaker | 3:fbb1fa853f09 | 59 | {0,0,1,1,1,0,0,0,0}, |
AhmedPlaymaker | 3:fbb1fa853f09 | 60 | {0,1,1,1,1,1,1,1,1}, |
AhmedPlaymaker | 3:fbb1fa853f09 | 61 | {0,0,1,1,1,0,0,0,0}, |
AhmedPlaymaker | 3:fbb1fa853f09 | 62 | {0,0,0,1,1,0,0,0,0}, |
AhmedPlaymaker | 3:fbb1fa853f09 | 63 | {0,0,0,0,1,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 64 | }; |
AhmedPlaymaker | 4:1fe015b66bb8 | 65 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 66 | int bullet[13][5] = { |
AhmedPlaymaker | 4:1fe015b66bb8 | 67 | {1,0,0,0,1}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 68 | {1,0,0,0,1}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 69 | {0,1,0,1,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 70 | {0,0,1,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 71 | {0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 72 | {0,0,1,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 73 | {0,0,1,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 74 | {0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 75 | {0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 76 | {0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 77 | {0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 78 | {0,0,1,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 79 | {0,0,1,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 80 | }; |
AhmedPlaymaker | 4:1fe015b66bb8 | 81 | int navL[13][8] = { |
AhmedPlaymaker | 4:1fe015b66bb8 | 82 | {0,0,0,0,0,0,1,1}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 83 | {0,0,0,0,0,1,1,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 84 | {0,0,0,0,1,1,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 85 | {0,0,0,1,1,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 86 | {0,0,1,1,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 87 | {0,1,1,0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 88 | {1,1,0,0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 89 | {0,1,1,0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 90 | {0,0,1,1,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 91 | {0,0,0,1,1,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 92 | {0,0,0,0,1,1,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 93 | {0,0,0,0,0,1,1,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 94 | {0,0,0,0,0,0,1,1}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 95 | }; |
AhmedPlaymaker | 3:fbb1fa853f09 | 96 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 97 | int navR[13][8] = { |
AhmedPlaymaker | 4:1fe015b66bb8 | 98 | {1,1,0,0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 99 | {0,1,1,0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 100 | {0,0,1,1,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 101 | {0,0,0,1,1,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 102 | {0,0,0,0,1,1,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 103 | {0,0,0,0,0,1,1,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 104 | {0,0,0,0,0,0,1,1}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 105 | {0,0,0,0,0,1,1,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 106 | {0,0,0,0,1,1,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 107 | {0,0,0,1,1,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 108 | {0,0,1,1,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 109 | {0,1,1,0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 110 | {1,1,0,0,0,0,0,0}, |
AhmedPlaymaker | 4:1fe015b66bb8 | 111 | }; |
AhmedPlaymaker | 4:1fe015b66bb8 | 112 | int i=16; |
AhmedPlaymaker | 4:1fe015b66bb8 | 113 | int lr=1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 114 | int gs=1; |
AhmedPlaymaker | 5:e4df87957a5b | 115 | int st=1; |
AhmedPlaymaker | 5:e4df87957a5b | 116 | int sc=1; |
AhmedPlaymaker | 5:e4df87957a5b | 117 | float cs = 4; |
AhmedPlaymaker | 16:7b474f873683 | 118 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 119 | StartScreen::StartScreen() |
AhmedPlaymaker | 3:fbb1fa853f09 | 120 | { |
AhmedPlaymaker | 3:fbb1fa853f09 | 121 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 122 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 123 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 124 | StartScreen::~StartScreen() |
AhmedPlaymaker | 3:fbb1fa853f09 | 125 | { |
AhmedPlaymaker | 3:fbb1fa853f09 | 126 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 127 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 128 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 129 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 130 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 131 | void StartScreen::screen_saver(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 3:fbb1fa853f09 | 132 | { |
AhmedPlaymaker | 6:3ffab44ed49c | 133 | int ani = -48; |
AhmedPlaymaker | 6:3ffab44ed49c | 134 | pad.leds_on(); |
AhmedPlaymaker | 6:3ffab44ed49c | 135 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 136 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 137 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 138 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 139 | pad.tone(440,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 140 | wait(0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 141 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 142 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 143 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 144 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 145 | pad.tone(494,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 146 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 147 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 148 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 149 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 150 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 151 | pad.tone(440,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 152 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 153 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 154 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 155 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 156 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 157 | pad.tone(370,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 158 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 159 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 160 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 161 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 162 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 163 | pad.tone(392,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 164 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 165 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 166 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 167 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 168 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 169 | pad.tone(370,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 170 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 171 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 172 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 173 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 174 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 175 | pad.tone(330,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 176 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 177 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 178 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 179 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 180 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 181 | pad.tone(247,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 182 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 183 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 184 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 185 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 186 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 187 | pad.tone(330,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 188 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 189 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 190 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 191 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 192 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 193 | pad.tone(330,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 194 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 195 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 196 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 197 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 198 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 199 | pad.tone(370,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 200 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 201 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 202 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 203 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 204 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 205 | pad.tone(555,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 206 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 207 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 208 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 209 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 210 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 211 | pad.tone(555,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 212 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 213 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 214 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 215 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 216 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 217 | pad.tone(494,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 218 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 219 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 220 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 221 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 222 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 223 | pad.tone(440,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 224 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 225 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 226 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 227 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 228 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 229 | pad.tone(392,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 230 | wait(0.2); |
AhmedPlaymaker | 6:3ffab44ed49c | 231 | lcd.clear(); |
AhmedPlaymaker | 6:3ffab44ed49c | 232 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 233 | ani+=3; |
AhmedPlaymaker | 6:3ffab44ed49c | 234 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 235 | pad.tone(392,0.1); |
AhmedPlaymaker | 6:3ffab44ed49c | 236 | wait(0.2); |
AhmedPlaymaker | 3:fbb1fa853f09 | 237 | lcd.clear(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 238 | lcd.drawSprite(0,0,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 6:3ffab44ed49c | 239 | ani+=3; |
AhmedPlaymaker | 3:fbb1fa853f09 | 240 | lcd.refresh(); |
AhmedPlaymaker | 6:3ffab44ed49c | 241 | pad.tone(370,0.1); |
AhmedPlaymaker | 16:7b474f873683 | 242 | wait(0.3); |
AhmedPlaymaker | 3:fbb1fa853f09 | 243 | pad.leds_off(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 244 | lcd.clear(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 245 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 246 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 247 | void StartScreen::instruct(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 3:fbb1fa853f09 | 248 | { |
AhmedPlaymaker | 15:f4d069da093d | 249 | wait(1/cs); |
AhmedPlaymaker | 3:fbb1fa853f09 | 250 | lcd.printString("Please Press",5,1); //Function used to promt the user to start. |
AhmedPlaymaker | 3:fbb1fa853f09 | 251 | lcd.printString("Start",25,3); |
AhmedPlaymaker | 3:fbb1fa853f09 | 252 | lcd.printString("to Begin",15,5); |
AhmedPlaymaker | 3:fbb1fa853f09 | 253 | lcd.refresh(); |
AhmedPlaymaker | 16:7b474f873683 | 254 | wait(1/cs); |
AhmedPlaymaker | 3:fbb1fa853f09 | 255 | while ( pad.check_event(Gamepad::START_PRESSED) == false) { |
AhmedPlaymaker | 3:fbb1fa853f09 | 256 | pad.leds_on(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 257 | wait(0.1); |
AhmedPlaymaker | 3:fbb1fa853f09 | 258 | pad.leds_off(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 259 | wait(0.1); |
AhmedPlaymaker | 3:fbb1fa853f09 | 260 | } |
AhmedPlaymaker | 6:3ffab44ed49c | 261 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 3:fbb1fa853f09 | 262 | lcd.clear(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 263 | pad.leds_off(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 264 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 265 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 266 | void StartScreen::info(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 3:fbb1fa853f09 | 267 | { |
AhmedPlaymaker | 5:e4df87957a5b | 268 | if(sc ==1) { |
AhmedPlaymaker | 5:e4df87957a5b | 269 | lcd.printString("Created BY",8,1); |
AhmedPlaymaker | 5:e4df87957a5b | 270 | lcd.printString("Ahmed",24,3); |
AhmedPlaymaker | 5:e4df87957a5b | 271 | lcd.printString("Adamjee",20,4); |
AhmedPlaymaker | 5:e4df87957a5b | 272 | lcd.printString("201161436",15,5); |
AhmedPlaymaker | 5:e4df87957a5b | 273 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 274 | wait(2); |
AhmedPlaymaker | 5:e4df87957a5b | 275 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 276 | lcd.clear(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 277 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 278 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 279 | void StartScreen::menu_screen1(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 3:fbb1fa853f09 | 280 | { |
AhmedPlaymaker | 7:48ba87cd79b5 | 281 | lcd.clear(); |
AhmedPlaymaker | 15:f4d069da093d | 282 | wait(1/cs); |
AhmedPlaymaker | 3:fbb1fa853f09 | 283 | lcd.drawSprite(50,i,7,9,(int *)arrow); |
AhmedPlaymaker | 16:7b474f873683 | 284 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 285 | while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. |
AhmedPlaymaker | 3:fbb1fa853f09 | 286 | lcd.printString("SnakeVSBlock",5,0); |
AhmedPlaymaker | 3:fbb1fa853f09 | 287 | lcd.printString("Play",0,2); |
AhmedPlaymaker | 3:fbb1fa853f09 | 288 | lcd.printString("Settings",0,3); |
AhmedPlaymaker | 3:fbb1fa853f09 | 289 | lcd.printString("Stats",0,4); |
AhmedPlaymaker | 3:fbb1fa853f09 | 290 | lcd.printString("Tutorial",0,5); |
AhmedPlaymaker | 3:fbb1fa853f09 | 291 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 292 | if((d==N)&&(i>16)) { |
AhmedPlaymaker | 3:fbb1fa853f09 | 293 | i=i-8; |
AhmedPlaymaker | 3:fbb1fa853f09 | 294 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 295 | if((d==S)&&(i<40)) { |
AhmedPlaymaker | 3:fbb1fa853f09 | 296 | i=i+8; |
AhmedPlaymaker | 3:fbb1fa853f09 | 297 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 298 | lcd.drawSprite(50,i,7,9,(int *)arrow); //Function used to draw the sprite. |
AhmedPlaymaker | 3:fbb1fa853f09 | 299 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 300 | wait(1/cs); |
AhmedPlaymaker | 3:fbb1fa853f09 | 301 | lcd.clear(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 302 | } |
AhmedPlaymaker | 6:3ffab44ed49c | 303 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 304 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 305 | if(i == 16) |
AhmedPlaymaker | 4:1fe015b66bb8 | 306 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 307 | menu_screen2(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 308 | } |
AhmedPlaymaker | 5:e4df87957a5b | 309 | else if(i == 24) |
AhmedPlaymaker | 5:e4df87957a5b | 310 | { |
AhmedPlaymaker | 5:e4df87957a5b | 311 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 312 | settings.info(lcd, pad); |
AhmedPlaymaker | 16:7b474f873683 | 313 | wait(1/cs); |
AhmedPlaymaker | 5:e4df87957a5b | 314 | while (pad.check_event(Gamepad::BACK_PRESSED) == false) { //if button pressed. |
AhmedPlaymaker | 5:e4df87957a5b | 315 | |
AhmedPlaymaker | 5:e4df87957a5b | 316 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 5:e4df87957a5b | 317 | wait(1/cs); |
AhmedPlaymaker | 5:e4df87957a5b | 318 | |
AhmedPlaymaker | 5:e4df87957a5b | 319 | if((d==E)&&(st==5)) { |
AhmedPlaymaker | 5:e4df87957a5b | 320 | st=1; |
AhmedPlaymaker | 5:e4df87957a5b | 321 | } |
AhmedPlaymaker | 5:e4df87957a5b | 322 | |
AhmedPlaymaker | 5:e4df87957a5b | 323 | else if((d==W)&&(st==1)) { |
AhmedPlaymaker | 5:e4df87957a5b | 324 | st=5; |
AhmedPlaymaker | 5:e4df87957a5b | 325 | } |
AhmedPlaymaker | 5:e4df87957a5b | 326 | |
AhmedPlaymaker | 5:e4df87957a5b | 327 | else if((d==E)&&(1<=st<=4)) { |
AhmedPlaymaker | 5:e4df87957a5b | 328 | st=st+1; |
AhmedPlaymaker | 5:e4df87957a5b | 329 | } |
AhmedPlaymaker | 5:e4df87957a5b | 330 | |
AhmedPlaymaker | 5:e4df87957a5b | 331 | else if((d==W)&&(2<=st<=5)) { |
AhmedPlaymaker | 5:e4df87957a5b | 332 | st=st-1; |
AhmedPlaymaker | 5:e4df87957a5b | 333 | } |
AhmedPlaymaker | 5:e4df87957a5b | 334 | |
AhmedPlaymaker | 5:e4df87957a5b | 335 | if(st==1) { |
AhmedPlaymaker | 5:e4df87957a5b | 336 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 337 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 338 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 339 | cs = settings.controlSensitivity(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 340 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 341 | } |
AhmedPlaymaker | 5:e4df87957a5b | 342 | if(st==2) { |
AhmedPlaymaker | 5:e4df87957a5b | 343 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 344 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 345 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 346 | settings.brigntness(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 347 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 348 | } |
AhmedPlaymaker | 5:e4df87957a5b | 349 | if(st==3) { |
AhmedPlaymaker | 5:e4df87957a5b | 350 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 351 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 352 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 353 | settings.contrast(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 354 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 355 | } |
AhmedPlaymaker | 5:e4df87957a5b | 356 | if(st==4) { |
AhmedPlaymaker | 5:e4df87957a5b | 357 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 358 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 359 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 360 | settings.volume(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 361 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 362 | } |
AhmedPlaymaker | 5:e4df87957a5b | 363 | if(st==5) { |
AhmedPlaymaker | 5:e4df87957a5b | 364 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 365 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 366 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 367 | sc = settings.showCredits(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 368 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 369 | } |
AhmedPlaymaker | 5:e4df87957a5b | 370 | } |
AhmedPlaymaker | 9:d1d79d4ee673 | 371 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 5:e4df87957a5b | 372 | menu_screen1(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 373 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 374 | else |
AhmedPlaymaker | 4:1fe015b66bb8 | 375 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 376 | menu_screen1(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 377 | lr=1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 378 | } |
AhmedPlaymaker | 5:e4df87957a5b | 379 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 380 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 381 | void StartScreen::menu_screen2(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 4:1fe015b66bb8 | 382 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 383 | lcd.clear(); |
AhmedPlaymaker | 16:7b474f873683 | 384 | wait(2/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 385 | while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. |
AhmedPlaymaker | 4:1fe015b66bb8 | 386 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 387 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 5:e4df87957a5b | 388 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 389 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 390 | if(((d==E)||(d==W))&&(lr==1)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 391 | lr=2; |
AhmedPlaymaker | 4:1fe015b66bb8 | 392 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 393 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 394 | else if(((d==E)||(d==W))&&(lr==2)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 395 | lr=1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 396 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 397 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 398 | if(lr==1) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 399 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 400 | lcd.drawRect(27,18,30,20,FILL_TRANSPARENT); |
AhmedPlaymaker | 4:1fe015b66bb8 | 401 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 402 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 403 | lcd.printString("Free Wave",14,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 404 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 405 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 406 | if(lr==2) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 407 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 408 | lcd.drawRect(27,18,30,20,FILL_TRANSPARENT); |
AhmedPlaymaker | 4:1fe015b66bb8 | 409 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 410 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 411 | lcd.printString("Bullet Shower",4,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 412 | lcd.drawSprite(29,19,13,5,(int *)bullet); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 413 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 414 | } |
AhmedPlaymaker | 16:7b474f873683 | 415 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 416 | if (pad.check_event(Gamepad::BACK_PRESSED) == true) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 417 | lcd.clear(); |
AhmedPlaymaker | 9:d1d79d4ee673 | 418 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 419 | menu_screen1(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 420 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 421 | } |
AhmedPlaymaker | 6:3ffab44ed49c | 422 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 423 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 424 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 425 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 426 | menu_screen3(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 427 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 428 | void StartScreen::menu_screen3(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 4:1fe015b66bb8 | 429 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 430 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 431 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 432 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 433 | while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. |
AhmedPlaymaker | 4:1fe015b66bb8 | 434 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 435 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 5:e4df87957a5b | 436 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 437 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 438 | if((d==E)&&(gs==4)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 439 | gs=1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 440 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 441 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 442 | else if((d==W)&&(gs==1)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 443 | gs=4; |
AhmedPlaymaker | 4:1fe015b66bb8 | 444 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 445 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 446 | else if((d==E)&&(1<=gs<=3)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 447 | gs=gs+1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 448 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 449 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 450 | else if((d==W)&&(2<=gs<=4)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 451 | gs=gs-1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 452 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 453 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 454 | if(gs==1) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 455 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 456 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 457 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 458 | lcd.printString("Game Speed",10,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 459 | lcd.printString("SNAIL",26,3); |
AhmedPlaymaker | 19:05cc9f801468 | 460 | fps = 10; |
AhmedPlaymaker | 4:1fe015b66bb8 | 461 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 462 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 463 | if(gs==2) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 464 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 465 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 466 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 467 | lcd.printString("Game Speed",10,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 468 | lcd.printString("TURTLE",24,3); |
AhmedPlaymaker | 19:05cc9f801468 | 469 | fps = 18; |
AhmedPlaymaker | 4:1fe015b66bb8 | 470 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 471 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 472 | if(gs==3) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 473 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 474 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 475 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 476 | lcd.printString("Game Speed",10,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 477 | lcd.printString("RABBIT",24,3); |
AhmedPlaymaker | 19:05cc9f801468 | 478 | fps = 25; |
AhmedPlaymaker | 4:1fe015b66bb8 | 479 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 480 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 481 | if(gs==4) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 482 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 483 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 484 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 485 | lcd.printString("Game Speed",10,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 486 | lcd.printString("CHEETHA",21,3); |
AhmedPlaymaker | 19:05cc9f801468 | 487 | fps = 33; |
AhmedPlaymaker | 4:1fe015b66bb8 | 488 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 489 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 490 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 491 | if (pad.check_event(Gamepad::BACK_PRESSED) == true) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 492 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 493 | wait(1/cs); |
AhmedPlaymaker | 9:d1d79d4ee673 | 494 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 495 | menu_screen2(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 496 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 497 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 498 | |
AhmedPlaymaker | 6:3ffab44ed49c | 499 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 500 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 501 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 502 | } |