Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

Committer:
AhmedPlaymaker
Date:
Tue Mar 26 14:45:15 2019 +0000
Revision:
7:48ba87cd79b5
Parent:
6:3ffab44ed49c
Child:
9:d1d79d4ee673
Game screen created, snake class and snake vs block class also created.

Who changed what in which revision?

UserRevisionLine numberNew 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:3ffab44ed49c 8 {1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,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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,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 3:fbb1fa853f09 118 StartScreen::StartScreen()
AhmedPlaymaker 3:fbb1fa853f09 119 {
AhmedPlaymaker 3:fbb1fa853f09 120
AhmedPlaymaker 3:fbb1fa853f09 121 }
AhmedPlaymaker 3:fbb1fa853f09 122
AhmedPlaymaker 3:fbb1fa853f09 123 StartScreen::~StartScreen()
AhmedPlaymaker 3:fbb1fa853f09 124 {
AhmedPlaymaker 3:fbb1fa853f09 125
AhmedPlaymaker 3:fbb1fa853f09 126 }
AhmedPlaymaker 3:fbb1fa853f09 127
AhmedPlaymaker 3:fbb1fa853f09 128
AhmedPlaymaker 3:fbb1fa853f09 129
AhmedPlaymaker 3:fbb1fa853f09 130 void StartScreen::screen_saver(N5110 &lcd, Gamepad &pad)
AhmedPlaymaker 3:fbb1fa853f09 131 {
AhmedPlaymaker 6:3ffab44ed49c 132 int ani = -48;
AhmedPlaymaker 6:3ffab44ed49c 133 pad.leds_on();
AhmedPlaymaker 6:3ffab44ed49c 134 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 135 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 136 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 137 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 138 pad.tone(440,0.1);
AhmedPlaymaker 6:3ffab44ed49c 139 wait(0.1);
AhmedPlaymaker 6:3ffab44ed49c 140 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 141 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 142 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 143 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 144 pad.tone(494,0.1);
AhmedPlaymaker 6:3ffab44ed49c 145 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 146 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 147 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 148 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 149 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 150 pad.tone(440,0.1);
AhmedPlaymaker 6:3ffab44ed49c 151 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 152 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 153 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 154 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 155 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 156 pad.tone(370,0.1);
AhmedPlaymaker 6:3ffab44ed49c 157 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 158 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 159 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 160 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 161 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 162 pad.tone(392,0.1);
AhmedPlaymaker 6:3ffab44ed49c 163 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 164 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 165 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 166 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 167 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 168 pad.tone(370,0.1);
AhmedPlaymaker 6:3ffab44ed49c 169 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 170 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 171 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 172 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 173 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 174 pad.tone(330,0.1);
AhmedPlaymaker 6:3ffab44ed49c 175 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 176 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 177 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 178 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 179 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 180 pad.tone(247,0.1);
AhmedPlaymaker 6:3ffab44ed49c 181 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 182 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 183 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 184 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 185 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 186 pad.tone(330,0.1);
AhmedPlaymaker 6:3ffab44ed49c 187 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 188 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 189 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 190 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 191 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 192 pad.tone(330,0.1);
AhmedPlaymaker 6:3ffab44ed49c 193 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 194 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 195 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 196 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 197 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 198 pad.tone(370,0.1);
AhmedPlaymaker 6:3ffab44ed49c 199 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 200 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 201 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 202 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 203 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 204 pad.tone(555,0.1);
AhmedPlaymaker 6:3ffab44ed49c 205 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 206 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 207 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 208 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 209 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 210 pad.tone(555,0.1);
AhmedPlaymaker 6:3ffab44ed49c 211 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 212 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 213 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 214 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 215 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 216 pad.tone(494,0.1);
AhmedPlaymaker 6:3ffab44ed49c 217 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 218 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 219 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 220 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 221 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 222 pad.tone(440,0.1);
AhmedPlaymaker 6:3ffab44ed49c 223 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 224 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 225 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 226 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 227 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 228 pad.tone(392,0.1);
AhmedPlaymaker 6:3ffab44ed49c 229 wait(0.2);
AhmedPlaymaker 6:3ffab44ed49c 230 lcd.clear();
AhmedPlaymaker 6:3ffab44ed49c 231 lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 232 ani+=3;
AhmedPlaymaker 6:3ffab44ed49c 233 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 234 pad.tone(392,0.1);
AhmedPlaymaker 6:3ffab44ed49c 235 wait(0.2);
AhmedPlaymaker 3:fbb1fa853f09 236 lcd.clear();
AhmedPlaymaker 3:fbb1fa853f09 237 lcd.drawSprite(0,0,48,84,(int *)sprite); //Function used to draw the sprite
AhmedPlaymaker 6:3ffab44ed49c 238 ani+=3;
AhmedPlaymaker 3:fbb1fa853f09 239 lcd.refresh();
AhmedPlaymaker 6:3ffab44ed49c 240 pad.tone(370,0.1);
AhmedPlaymaker 6:3ffab44ed49c 241 wait(0.6);
AhmedPlaymaker 3:fbb1fa853f09 242 pad.leds_off();
AhmedPlaymaker 3:fbb1fa853f09 243 lcd.clear();
AhmedPlaymaker 3:fbb1fa853f09 244 }
AhmedPlaymaker 3:fbb1fa853f09 245
AhmedPlaymaker 3:fbb1fa853f09 246 void StartScreen::instruct(N5110 &lcd, Gamepad &pad)
AhmedPlaymaker 3:fbb1fa853f09 247 {
AhmedPlaymaker 3:fbb1fa853f09 248 lcd.printString("Please Press",5,1); //Function used to promt the user to start.
AhmedPlaymaker 3:fbb1fa853f09 249 lcd.printString("Start",25,3);
AhmedPlaymaker 3:fbb1fa853f09 250 lcd.printString("to Begin",15,5);
AhmedPlaymaker 3:fbb1fa853f09 251 lcd.refresh();
AhmedPlaymaker 3:fbb1fa853f09 252 while ( pad.check_event(Gamepad::START_PRESSED) == false) {
AhmedPlaymaker 3:fbb1fa853f09 253 pad.leds_on();
AhmedPlaymaker 3:fbb1fa853f09 254 wait(0.1);
AhmedPlaymaker 3:fbb1fa853f09 255 pad.leds_off();
AhmedPlaymaker 3:fbb1fa853f09 256 wait(0.1);
AhmedPlaymaker 3:fbb1fa853f09 257 }
AhmedPlaymaker 6:3ffab44ed49c 258 pad.tone(1000.0,0.1);
AhmedPlaymaker 3:fbb1fa853f09 259 lcd.clear();
AhmedPlaymaker 3:fbb1fa853f09 260 pad.leds_off();
AhmedPlaymaker 3:fbb1fa853f09 261 }
AhmedPlaymaker 3:fbb1fa853f09 262
AhmedPlaymaker 3:fbb1fa853f09 263 void StartScreen::info(N5110 &lcd, Gamepad &pad)
AhmedPlaymaker 3:fbb1fa853f09 264 {
AhmedPlaymaker 5:e4df87957a5b 265 if(sc ==1) {
AhmedPlaymaker 5:e4df87957a5b 266 lcd.printString("Created BY",8,1);
AhmedPlaymaker 5:e4df87957a5b 267 lcd.printString("Ahmed",24,3);
AhmedPlaymaker 5:e4df87957a5b 268 lcd.printString("Adamjee",20,4);
AhmedPlaymaker 5:e4df87957a5b 269 lcd.printString("201161436",15,5);
AhmedPlaymaker 5:e4df87957a5b 270 lcd.refresh();
AhmedPlaymaker 5:e4df87957a5b 271 wait(2);
AhmedPlaymaker 5:e4df87957a5b 272 }
AhmedPlaymaker 3:fbb1fa853f09 273 lcd.clear();
AhmedPlaymaker 3:fbb1fa853f09 274 }
AhmedPlaymaker 3:fbb1fa853f09 275
AhmedPlaymaker 3:fbb1fa853f09 276 void StartScreen::menu_screen1(N5110 &lcd, Gamepad &pad)
AhmedPlaymaker 3:fbb1fa853f09 277 {
AhmedPlaymaker 7:48ba87cd79b5 278 lcd.clear();
AhmedPlaymaker 3:fbb1fa853f09 279 lcd.drawSprite(50,i,7,9,(int *)arrow);
AhmedPlaymaker 4:1fe015b66bb8 280 while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed.
AhmedPlaymaker 3:fbb1fa853f09 281 lcd.printString("SnakeVSBlock",5,0);
AhmedPlaymaker 3:fbb1fa853f09 282 lcd.printString("Play",0,2);
AhmedPlaymaker 3:fbb1fa853f09 283 lcd.printString("Settings",0,3);
AhmedPlaymaker 3:fbb1fa853f09 284 lcd.printString("Stats",0,4);
AhmedPlaymaker 3:fbb1fa853f09 285 lcd.printString("Tutorial",0,5);
AhmedPlaymaker 3:fbb1fa853f09 286 Direction d = pad.get_direction();
AhmedPlaymaker 3:fbb1fa853f09 287 if((d==N)&&(i>16)) {
AhmedPlaymaker 3:fbb1fa853f09 288 i=i-8;
AhmedPlaymaker 3:fbb1fa853f09 289 }
AhmedPlaymaker 3:fbb1fa853f09 290 if((d==S)&&(i<40)) {
AhmedPlaymaker 3:fbb1fa853f09 291 i=i+8;
AhmedPlaymaker 3:fbb1fa853f09 292 }
AhmedPlaymaker 3:fbb1fa853f09 293 lcd.drawSprite(50,i,7,9,(int *)arrow); //Function used to draw the sprite.
AhmedPlaymaker 3:fbb1fa853f09 294 lcd.refresh();
AhmedPlaymaker 5:e4df87957a5b 295 wait(1/cs);
AhmedPlaymaker 3:fbb1fa853f09 296 lcd.clear();
AhmedPlaymaker 3:fbb1fa853f09 297 }
AhmedPlaymaker 6:3ffab44ed49c 298 pad.tone(1000.0,0.1);
AhmedPlaymaker 4:1fe015b66bb8 299
AhmedPlaymaker 4:1fe015b66bb8 300 if(i == 16)
AhmedPlaymaker 4:1fe015b66bb8 301 {
AhmedPlaymaker 4:1fe015b66bb8 302 menu_screen2(lcd, pad);
AhmedPlaymaker 4:1fe015b66bb8 303 }
AhmedPlaymaker 5:e4df87957a5b 304 else if(i == 24)
AhmedPlaymaker 5:e4df87957a5b 305 {
AhmedPlaymaker 5:e4df87957a5b 306 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 307 settings.info(lcd, pad);
AhmedPlaymaker 5:e4df87957a5b 308
AhmedPlaymaker 5:e4df87957a5b 309 while (pad.check_event(Gamepad::BACK_PRESSED) == false) { //if button pressed.
AhmedPlaymaker 5:e4df87957a5b 310
AhmedPlaymaker 5:e4df87957a5b 311 Direction d = pad.get_direction();
AhmedPlaymaker 5:e4df87957a5b 312 wait(1/cs);
AhmedPlaymaker 5:e4df87957a5b 313
AhmedPlaymaker 5:e4df87957a5b 314 if((d==E)&&(st==5)) {
AhmedPlaymaker 5:e4df87957a5b 315 st=1;
AhmedPlaymaker 5:e4df87957a5b 316 }
AhmedPlaymaker 5:e4df87957a5b 317
AhmedPlaymaker 5:e4df87957a5b 318 else if((d==W)&&(st==1)) {
AhmedPlaymaker 5:e4df87957a5b 319 st=5;
AhmedPlaymaker 5:e4df87957a5b 320 }
AhmedPlaymaker 5:e4df87957a5b 321
AhmedPlaymaker 5:e4df87957a5b 322 else if((d==E)&&(1<=st<=4)) {
AhmedPlaymaker 5:e4df87957a5b 323 st=st+1;
AhmedPlaymaker 5:e4df87957a5b 324 }
AhmedPlaymaker 5:e4df87957a5b 325
AhmedPlaymaker 5:e4df87957a5b 326 else if((d==W)&&(2<=st<=5)) {
AhmedPlaymaker 5:e4df87957a5b 327 st=st-1;
AhmedPlaymaker 5:e4df87957a5b 328 }
AhmedPlaymaker 5:e4df87957a5b 329
AhmedPlaymaker 5:e4df87957a5b 330 if(st==1) {
AhmedPlaymaker 5:e4df87957a5b 331 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 332 lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite.
AhmedPlaymaker 5:e4df87957a5b 333 lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite.
AhmedPlaymaker 5:e4df87957a5b 334 cs = settings.controlSensitivity(lcd, pad);
AhmedPlaymaker 5:e4df87957a5b 335 lcd.refresh();
AhmedPlaymaker 5:e4df87957a5b 336 }
AhmedPlaymaker 5:e4df87957a5b 337 if(st==2) {
AhmedPlaymaker 5:e4df87957a5b 338 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 339 lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite.
AhmedPlaymaker 5:e4df87957a5b 340 lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite.
AhmedPlaymaker 5:e4df87957a5b 341 settings.brigntness(lcd, pad);
AhmedPlaymaker 5:e4df87957a5b 342 lcd.refresh();
AhmedPlaymaker 5:e4df87957a5b 343 }
AhmedPlaymaker 5:e4df87957a5b 344 if(st==3) {
AhmedPlaymaker 5:e4df87957a5b 345 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 346 lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite.
AhmedPlaymaker 5:e4df87957a5b 347 lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite.
AhmedPlaymaker 5:e4df87957a5b 348 settings.contrast(lcd, pad);
AhmedPlaymaker 5:e4df87957a5b 349 lcd.refresh();
AhmedPlaymaker 5:e4df87957a5b 350 }
AhmedPlaymaker 5:e4df87957a5b 351 if(st==4) {
AhmedPlaymaker 5:e4df87957a5b 352 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 353 lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite.
AhmedPlaymaker 5:e4df87957a5b 354 lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite.
AhmedPlaymaker 5:e4df87957a5b 355 settings.volume(lcd, pad);
AhmedPlaymaker 5:e4df87957a5b 356 lcd.refresh();
AhmedPlaymaker 5:e4df87957a5b 357 }
AhmedPlaymaker 5:e4df87957a5b 358 if(st==5) {
AhmedPlaymaker 5:e4df87957a5b 359 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 360 lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite.
AhmedPlaymaker 5:e4df87957a5b 361 lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite.
AhmedPlaymaker 5:e4df87957a5b 362 sc = settings.showCredits(lcd, pad);
AhmedPlaymaker 5:e4df87957a5b 363 lcd.refresh();
AhmedPlaymaker 5:e4df87957a5b 364 }
AhmedPlaymaker 5:e4df87957a5b 365 }
AhmedPlaymaker 5:e4df87957a5b 366 menu_screen1(lcd, pad);
AhmedPlaymaker 6:3ffab44ed49c 367 pad.tone(1000.0,0.1);
AhmedPlaymaker 5:e4df87957a5b 368 }
AhmedPlaymaker 4:1fe015b66bb8 369 else
AhmedPlaymaker 4:1fe015b66bb8 370 {
AhmedPlaymaker 4:1fe015b66bb8 371 menu_screen1(lcd, pad);
AhmedPlaymaker 4:1fe015b66bb8 372 lr=1;
AhmedPlaymaker 4:1fe015b66bb8 373 }
AhmedPlaymaker 5:e4df87957a5b 374
AhmedPlaymaker 3:fbb1fa853f09 375 }
AhmedPlaymaker 4:1fe015b66bb8 376 void StartScreen::menu_screen2(N5110 &lcd, Gamepad &pad)
AhmedPlaymaker 4:1fe015b66bb8 377 {
AhmedPlaymaker 4:1fe015b66bb8 378 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 379 wait(1/cs);
AhmedPlaymaker 4:1fe015b66bb8 380
AhmedPlaymaker 4:1fe015b66bb8 381 while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed.
AhmedPlaymaker 4:1fe015b66bb8 382
AhmedPlaymaker 4:1fe015b66bb8 383 Direction d = pad.get_direction();
AhmedPlaymaker 5:e4df87957a5b 384 wait(1/cs);
AhmedPlaymaker 4:1fe015b66bb8 385
AhmedPlaymaker 4:1fe015b66bb8 386 if(((d==E)||(d==W))&&(lr==1)) {
AhmedPlaymaker 4:1fe015b66bb8 387 lr=2;
AhmedPlaymaker 4:1fe015b66bb8 388 }
AhmedPlaymaker 4:1fe015b66bb8 389
AhmedPlaymaker 4:1fe015b66bb8 390 else if(((d==E)||(d==W))&&(lr==2)) {
AhmedPlaymaker 4:1fe015b66bb8 391 lr=1;
AhmedPlaymaker 4:1fe015b66bb8 392 }
AhmedPlaymaker 4:1fe015b66bb8 393
AhmedPlaymaker 4:1fe015b66bb8 394 if(lr==1) {
AhmedPlaymaker 4:1fe015b66bb8 395 lcd.clear();
AhmedPlaymaker 4:1fe015b66bb8 396 lcd.drawRect(27,18,30,20,FILL_TRANSPARENT);
AhmedPlaymaker 4:1fe015b66bb8 397 lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 398 lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 399 lcd.printString("Free Wave",14,1);
AhmedPlaymaker 4:1fe015b66bb8 400 lcd.refresh();
AhmedPlaymaker 4:1fe015b66bb8 401 }
AhmedPlaymaker 4:1fe015b66bb8 402 if(lr==2) {
AhmedPlaymaker 4:1fe015b66bb8 403 lcd.clear();
AhmedPlaymaker 4:1fe015b66bb8 404 lcd.drawRect(27,18,30,20,FILL_TRANSPARENT);
AhmedPlaymaker 4:1fe015b66bb8 405 lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 406 lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 407 lcd.printString("Bullet Shower",4,1);
AhmedPlaymaker 4:1fe015b66bb8 408 lcd.drawSprite(29,19,13,5,(int *)bullet); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 409 lcd.refresh();
AhmedPlaymaker 4:1fe015b66bb8 410 }
AhmedPlaymaker 4:1fe015b66bb8 411 if (pad.check_event(Gamepad::BACK_PRESSED) == true) {
AhmedPlaymaker 4:1fe015b66bb8 412 lcd.clear();
AhmedPlaymaker 4:1fe015b66bb8 413 menu_screen1(lcd, pad);
AhmedPlaymaker 4:1fe015b66bb8 414 }
AhmedPlaymaker 4:1fe015b66bb8 415 }
AhmedPlaymaker 6:3ffab44ed49c 416 pad.tone(1000.0,0.1);
AhmedPlaymaker 4:1fe015b66bb8 417
AhmedPlaymaker 4:1fe015b66bb8 418 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 419 wait(1/cs);
AhmedPlaymaker 4:1fe015b66bb8 420 menu_screen3(lcd, pad);
AhmedPlaymaker 4:1fe015b66bb8 421 }
AhmedPlaymaker 4:1fe015b66bb8 422 void StartScreen::menu_screen3(N5110 &lcd, Gamepad &pad)
AhmedPlaymaker 4:1fe015b66bb8 423 {
AhmedPlaymaker 4:1fe015b66bb8 424 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 425 wait(1/cs);
AhmedPlaymaker 4:1fe015b66bb8 426
AhmedPlaymaker 4:1fe015b66bb8 427 while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed.
AhmedPlaymaker 4:1fe015b66bb8 428
AhmedPlaymaker 4:1fe015b66bb8 429 Direction d = pad.get_direction();
AhmedPlaymaker 5:e4df87957a5b 430 wait(1/cs);
AhmedPlaymaker 4:1fe015b66bb8 431
AhmedPlaymaker 4:1fe015b66bb8 432 if((d==E)&&(gs==4)) {
AhmedPlaymaker 4:1fe015b66bb8 433 gs=1;
AhmedPlaymaker 4:1fe015b66bb8 434 }
AhmedPlaymaker 4:1fe015b66bb8 435
AhmedPlaymaker 4:1fe015b66bb8 436 else if((d==W)&&(gs==1)) {
AhmedPlaymaker 4:1fe015b66bb8 437 gs=4;
AhmedPlaymaker 4:1fe015b66bb8 438 }
AhmedPlaymaker 4:1fe015b66bb8 439
AhmedPlaymaker 4:1fe015b66bb8 440 else if((d==E)&&(1<=gs<=3)) {
AhmedPlaymaker 4:1fe015b66bb8 441 gs=gs+1;
AhmedPlaymaker 4:1fe015b66bb8 442 }
AhmedPlaymaker 4:1fe015b66bb8 443
AhmedPlaymaker 4:1fe015b66bb8 444 else if((d==W)&&(2<=gs<=4)) {
AhmedPlaymaker 4:1fe015b66bb8 445 gs=gs-1;
AhmedPlaymaker 4:1fe015b66bb8 446 }
AhmedPlaymaker 4:1fe015b66bb8 447
AhmedPlaymaker 4:1fe015b66bb8 448 if(gs==1) {
AhmedPlaymaker 4:1fe015b66bb8 449 lcd.clear();
AhmedPlaymaker 4:1fe015b66bb8 450 lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 451 lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 452 lcd.printString("Game Speed",10,1);
AhmedPlaymaker 4:1fe015b66bb8 453 lcd.printString("SNAIL",26,3);
AhmedPlaymaker 4:1fe015b66bb8 454 lcd.refresh();
AhmedPlaymaker 4:1fe015b66bb8 455 }
AhmedPlaymaker 4:1fe015b66bb8 456 if(gs==2) {
AhmedPlaymaker 4:1fe015b66bb8 457 lcd.clear();
AhmedPlaymaker 4:1fe015b66bb8 458 lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 459 lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 460 lcd.printString("Game Speed",10,1);
AhmedPlaymaker 4:1fe015b66bb8 461 lcd.printString("TURTLE",24,3);
AhmedPlaymaker 4:1fe015b66bb8 462 lcd.refresh();
AhmedPlaymaker 4:1fe015b66bb8 463 }
AhmedPlaymaker 4:1fe015b66bb8 464 if(gs==3) {
AhmedPlaymaker 4:1fe015b66bb8 465 lcd.clear();
AhmedPlaymaker 4:1fe015b66bb8 466 lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 467 lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite.
AhmedPlaymaker 4:1fe015b66bb8 468 lcd.printString("Game Speed",10,1);
AhmedPlaymaker 4:1fe015b66bb8 469 lcd.printString("RABBIT",24,3);
AhmedPlaymaker 4:1fe015b66bb8 470 lcd.refresh();
AhmedPlaymaker 4:1fe015b66bb8 471 }
AhmedPlaymaker 4:1fe015b66bb8 472 if(gs==4) {
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("CHEETHA",21,3);
AhmedPlaymaker 4:1fe015b66bb8 478 lcd.refresh();
AhmedPlaymaker 4:1fe015b66bb8 479 }
AhmedPlaymaker 4:1fe015b66bb8 480
AhmedPlaymaker 4:1fe015b66bb8 481 if (pad.check_event(Gamepad::BACK_PRESSED) == true) {
AhmedPlaymaker 4:1fe015b66bb8 482 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 483 wait(1/cs);
AhmedPlaymaker 4:1fe015b66bb8 484 menu_screen2(lcd, pad);
AhmedPlaymaker 4:1fe015b66bb8 485 }
AhmedPlaymaker 4:1fe015b66bb8 486 }
AhmedPlaymaker 4:1fe015b66bb8 487
AhmedPlaymaker 6:3ffab44ed49c 488 pad.tone(1000.0,0.1);
AhmedPlaymaker 4:1fe015b66bb8 489 lcd.clear();
AhmedPlaymaker 5:e4df87957a5b 490 wait(1/cs);
AhmedPlaymaker 4:1fe015b66bb8 491 }