Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
StartScreen/StartScreen.cpp@26:3495f7b0ede7, 2019-04-11 (annotated)
- Committer:
- AhmedPlaymaker
- Date:
- Thu Apr 11 05:34:03 2019 +0000
- Revision:
- 26:3495f7b0ede7
- Parent:
- 21:e41126528cc6
- Child:
- 28:d2c621d67e3b
Made the Start Screen Class shorter
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:3ffab44ed49c | 8 | {1,0,0,0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{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 | 26:3495f7b0ede7 | 133 | int song[18] = {441,494,439,372,392,370,330,246,329,331,370,555,555,495,440,392,392,370}; |
AhmedPlaymaker | 6:3ffab44ed49c | 134 | pad.leds_on(); |
AhmedPlaymaker | 26:3495f7b0ede7 | 135 | |
AhmedPlaymaker | 26:3495f7b0ede7 | 136 | for(int ani = -48; ani <= 0; ani+=3) { |
AhmedPlaymaker | 26:3495f7b0ede7 | 137 | lcd.clear(); |
AhmedPlaymaker | 26:3495f7b0ede7 | 138 | lcd.drawSprite(0,ani,48,84,(int *)sprite); //Function used to draw the sprite |
AhmedPlaymaker | 26:3495f7b0ede7 | 139 | lcd.refresh(); |
AhmedPlaymaker | 26:3495f7b0ede7 | 140 | pad.tone(song[(ani+48)/3],0.1); |
AhmedPlaymaker | 26:3495f7b0ede7 | 141 | wait(0.2); |
AhmedPlaymaker | 26:3495f7b0ede7 | 142 | } |
AhmedPlaymaker | 26:3495f7b0ede7 | 143 | |
AhmedPlaymaker | 16:7b474f873683 | 144 | wait(0.3); |
AhmedPlaymaker | 3:fbb1fa853f09 | 145 | pad.leds_off(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 146 | lcd.clear(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 147 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 148 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 149 | void StartScreen::instruct(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 3:fbb1fa853f09 | 150 | { |
AhmedPlaymaker | 15:f4d069da093d | 151 | wait(1/cs); |
AhmedPlaymaker | 3:fbb1fa853f09 | 152 | lcd.printString("Please Press",5,1); //Function used to promt the user to start. |
AhmedPlaymaker | 3:fbb1fa853f09 | 153 | lcd.printString("Start",25,3); |
AhmedPlaymaker | 3:fbb1fa853f09 | 154 | lcd.printString("to Begin",15,5); |
AhmedPlaymaker | 3:fbb1fa853f09 | 155 | lcd.refresh(); |
AhmedPlaymaker | 16:7b474f873683 | 156 | wait(1/cs); |
AhmedPlaymaker | 3:fbb1fa853f09 | 157 | while ( pad.check_event(Gamepad::START_PRESSED) == false) { |
AhmedPlaymaker | 3:fbb1fa853f09 | 158 | pad.leds_on(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 159 | wait(0.1); |
AhmedPlaymaker | 3:fbb1fa853f09 | 160 | pad.leds_off(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 161 | wait(0.1); |
AhmedPlaymaker | 3:fbb1fa853f09 | 162 | } |
AhmedPlaymaker | 6:3ffab44ed49c | 163 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 3:fbb1fa853f09 | 164 | lcd.clear(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 165 | pad.leds_off(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 166 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 167 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 168 | void StartScreen::info(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 3:fbb1fa853f09 | 169 | { |
AhmedPlaymaker | 5:e4df87957a5b | 170 | if(sc ==1) { |
AhmedPlaymaker | 5:e4df87957a5b | 171 | lcd.printString("Created BY",8,1); |
AhmedPlaymaker | 5:e4df87957a5b | 172 | lcd.printString("Ahmed",24,3); |
AhmedPlaymaker | 5:e4df87957a5b | 173 | lcd.printString("Adamjee",20,4); |
AhmedPlaymaker | 5:e4df87957a5b | 174 | lcd.printString("201161436",15,5); |
AhmedPlaymaker | 5:e4df87957a5b | 175 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 176 | wait(2); |
AhmedPlaymaker | 5:e4df87957a5b | 177 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 178 | lcd.clear(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 179 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 180 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 181 | void StartScreen::menu_screen1(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 3:fbb1fa853f09 | 182 | { |
AhmedPlaymaker | 7:48ba87cd79b5 | 183 | lcd.clear(); |
AhmedPlaymaker | 15:f4d069da093d | 184 | wait(1/cs); |
AhmedPlaymaker | 3:fbb1fa853f09 | 185 | lcd.drawSprite(50,i,7,9,(int *)arrow); |
AhmedPlaymaker | 16:7b474f873683 | 186 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 187 | while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. |
AhmedPlaymaker | 3:fbb1fa853f09 | 188 | lcd.printString("SnakeVSBlock",5,0); |
AhmedPlaymaker | 3:fbb1fa853f09 | 189 | lcd.printString("Play",0,2); |
AhmedPlaymaker | 3:fbb1fa853f09 | 190 | lcd.printString("Settings",0,3); |
AhmedPlaymaker | 3:fbb1fa853f09 | 191 | lcd.printString("Stats",0,4); |
AhmedPlaymaker | 3:fbb1fa853f09 | 192 | lcd.printString("Tutorial",0,5); |
AhmedPlaymaker | 3:fbb1fa853f09 | 193 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 194 | if((d==N)&&(i>16)) { |
AhmedPlaymaker | 3:fbb1fa853f09 | 195 | i=i-8; |
AhmedPlaymaker | 3:fbb1fa853f09 | 196 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 197 | if((d==S)&&(i<40)) { |
AhmedPlaymaker | 3:fbb1fa853f09 | 198 | i=i+8; |
AhmedPlaymaker | 3:fbb1fa853f09 | 199 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 200 | lcd.drawSprite(50,i,7,9,(int *)arrow); //Function used to draw the sprite. |
AhmedPlaymaker | 3:fbb1fa853f09 | 201 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 202 | wait(1/cs); |
AhmedPlaymaker | 3:fbb1fa853f09 | 203 | lcd.clear(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 204 | } |
AhmedPlaymaker | 6:3ffab44ed49c | 205 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 206 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 207 | if(i == 16) |
AhmedPlaymaker | 4:1fe015b66bb8 | 208 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 209 | menu_screen2(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 210 | } |
AhmedPlaymaker | 5:e4df87957a5b | 211 | else if(i == 24) |
AhmedPlaymaker | 5:e4df87957a5b | 212 | { |
AhmedPlaymaker | 5:e4df87957a5b | 213 | settings.info(lcd, pad); |
AhmedPlaymaker | 16:7b474f873683 | 214 | wait(1/cs); |
AhmedPlaymaker | 5:e4df87957a5b | 215 | while (pad.check_event(Gamepad::BACK_PRESSED) == false) { //if button pressed. |
AhmedPlaymaker | 5:e4df87957a5b | 216 | |
AhmedPlaymaker | 5:e4df87957a5b | 217 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 5:e4df87957a5b | 218 | wait(1/cs); |
AhmedPlaymaker | 26:3495f7b0ede7 | 219 | lcd.clear(); |
AhmedPlaymaker | 26:3495f7b0ede7 | 220 | |
AhmedPlaymaker | 5:e4df87957a5b | 221 | if((d==E)&&(st==5)) { |
AhmedPlaymaker | 5:e4df87957a5b | 222 | st=1; |
AhmedPlaymaker | 5:e4df87957a5b | 223 | } |
AhmedPlaymaker | 5:e4df87957a5b | 224 | else if((d==W)&&(st==1)) { |
AhmedPlaymaker | 5:e4df87957a5b | 225 | st=5; |
AhmedPlaymaker | 5:e4df87957a5b | 226 | } |
AhmedPlaymaker | 5:e4df87957a5b | 227 | else if((d==E)&&(1<=st<=4)) { |
AhmedPlaymaker | 5:e4df87957a5b | 228 | st=st+1; |
AhmedPlaymaker | 5:e4df87957a5b | 229 | } |
AhmedPlaymaker | 5:e4df87957a5b | 230 | else if((d==W)&&(2<=st<=5)) { |
AhmedPlaymaker | 5:e4df87957a5b | 231 | st=st-1; |
AhmedPlaymaker | 5:e4df87957a5b | 232 | } |
AhmedPlaymaker | 5:e4df87957a5b | 233 | |
AhmedPlaymaker | 26:3495f7b0ede7 | 234 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 26:3495f7b0ede7 | 235 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 236 | if(st==1) { |
AhmedPlaymaker | 5:e4df87957a5b | 237 | cs = settings.controlSensitivity(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 238 | } |
AhmedPlaymaker | 5:e4df87957a5b | 239 | if(st==2) { |
AhmedPlaymaker | 5:e4df87957a5b | 240 | settings.brigntness(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 241 | } |
AhmedPlaymaker | 5:e4df87957a5b | 242 | if(st==3) { |
AhmedPlaymaker | 5:e4df87957a5b | 243 | settings.contrast(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 244 | } |
AhmedPlaymaker | 5:e4df87957a5b | 245 | if(st==4) { |
AhmedPlaymaker | 5:e4df87957a5b | 246 | settings.volume(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 247 | } |
AhmedPlaymaker | 5:e4df87957a5b | 248 | if(st==5) { |
AhmedPlaymaker | 5:e4df87957a5b | 249 | sc = settings.showCredits(lcd, pad); |
AhmedPlaymaker | 26:3495f7b0ede7 | 250 | } |
AhmedPlaymaker | 26:3495f7b0ede7 | 251 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 252 | } |
AhmedPlaymaker | 9:d1d79d4ee673 | 253 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 5:e4df87957a5b | 254 | menu_screen1(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 255 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 256 | else |
AhmedPlaymaker | 4:1fe015b66bb8 | 257 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 258 | menu_screen1(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 259 | lr=1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 260 | } |
AhmedPlaymaker | 5:e4df87957a5b | 261 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 262 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 263 | void StartScreen::menu_screen2(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 4:1fe015b66bb8 | 264 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 265 | lcd.clear(); |
AhmedPlaymaker | 16:7b474f873683 | 266 | wait(2/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 267 | while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. |
AhmedPlaymaker | 26:3495f7b0ede7 | 268 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 269 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 26:3495f7b0ede7 | 270 | lcd.clear(); |
AhmedPlaymaker | 26:3495f7b0ede7 | 271 | lcd.drawRect(27,18,30,20,FILL_TRANSPARENT); |
AhmedPlaymaker | 26:3495f7b0ede7 | 272 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 26:3495f7b0ede7 | 273 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 26:3495f7b0ede7 | 274 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 275 | if(((d==E)||(d==W))&&(lr==1)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 276 | lr=2; |
AhmedPlaymaker | 4:1fe015b66bb8 | 277 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 278 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 279 | else if(((d==E)||(d==W))&&(lr==2)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 280 | lr=1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 281 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 282 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 283 | if(lr==1) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 284 | lcd.printString("Free Wave",14,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 285 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 286 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 287 | if(lr==2) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 288 | lcd.printString("Bullet Shower",4,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 289 | lcd.drawSprite(29,19,13,5,(int *)bullet); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 290 | } |
AhmedPlaymaker | 16:7b474f873683 | 291 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 292 | if (pad.check_event(Gamepad::BACK_PRESSED) == true) { |
AhmedPlaymaker | 9:d1d79d4ee673 | 293 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 294 | menu_screen1(lcd, pad); |
AhmedPlaymaker | 26:3495f7b0ede7 | 295 | } |
AhmedPlaymaker | 26:3495f7b0ede7 | 296 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 297 | } |
AhmedPlaymaker | 6:3ffab44ed49c | 298 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 299 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 300 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 301 | menu_screen3(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 302 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 303 | void StartScreen::menu_screen3(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 4:1fe015b66bb8 | 304 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 305 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 306 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 307 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 308 | while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. |
AhmedPlaymaker | 4:1fe015b66bb8 | 309 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 310 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 5:e4df87957a5b | 311 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 312 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 313 | if((d==E)&&(gs==4)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 314 | gs=1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 315 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 316 | else if((d==W)&&(gs==1)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 317 | gs=4; |
AhmedPlaymaker | 4:1fe015b66bb8 | 318 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 319 | else if((d==E)&&(1<=gs<=3)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 320 | gs=gs+1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 321 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 322 | else if((d==W)&&(2<=gs<=4)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 323 | gs=gs-1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 324 | } |
AhmedPlaymaker | 26:3495f7b0ede7 | 325 | lcd.clear(); |
AhmedPlaymaker | 26:3495f7b0ede7 | 326 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 26:3495f7b0ede7 | 327 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 26:3495f7b0ede7 | 328 | lcd.printString("Game Speed",10,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 329 | if(gs==1) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 330 | lcd.printString("SNAIL",26,3); |
AhmedPlaymaker | 19:05cc9f801468 | 331 | fps = 10; |
AhmedPlaymaker | 4:1fe015b66bb8 | 332 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 333 | if(gs==2) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 334 | lcd.printString("TURTLE",24,3); |
AhmedPlaymaker | 19:05cc9f801468 | 335 | fps = 18; |
AhmedPlaymaker | 4:1fe015b66bb8 | 336 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 337 | if(gs==3) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 338 | lcd.printString("RABBIT",24,3); |
AhmedPlaymaker | 19:05cc9f801468 | 339 | fps = 25; |
AhmedPlaymaker | 4:1fe015b66bb8 | 340 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 341 | if(gs==4) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 342 | lcd.printString("CHEETHA",21,3); |
AhmedPlaymaker | 19:05cc9f801468 | 343 | fps = 33; |
AhmedPlaymaker | 4:1fe015b66bb8 | 344 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 345 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 346 | if (pad.check_event(Gamepad::BACK_PRESSED) == true) { |
AhmedPlaymaker | 5:e4df87957a5b | 347 | wait(1/cs); |
AhmedPlaymaker | 9:d1d79d4ee673 | 348 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 349 | menu_screen2(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 350 | } |
AhmedPlaymaker | 26:3495f7b0ede7 | 351 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 352 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 353 | |
AhmedPlaymaker | 6:3ffab44ed49c | 354 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 355 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 356 | wait(1/cs); |
AhmedPlaymaker | 26:3495f7b0ede7 | 357 | lcd.printString("Level:",25,1); //created so that the gamer can keep track of their game. //change this to be operated remotely |
AhmedPlaymaker | 21:e41126528cc6 | 358 | lcd.printString("1",40,3); |
AhmedPlaymaker | 21:e41126528cc6 | 359 | lcd.refresh(); |
AhmedPlaymaker | 21:e41126528cc6 | 360 | wait(2); |
AhmedPlaymaker | 4:1fe015b66bb8 | 361 | } |