Ahmed Adamjee
/
SnakeVSBlock
Snake vs Block Game to be run upon K64F.
StartScreen/StartScreen.cpp@6:3ffab44ed49c, 2019-03-23 (annotated)
- Committer:
- AhmedPlaymaker
- Date:
- Sat Mar 23 15:07:15 2019 +0000
- Revision:
- 6:3ffab44ed49c
- Parent:
- 5:e4df87957a5b
- Child:
- 7:48ba87cd79b5
Added some tones and animation in Launch
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 | 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 | 3:fbb1fa853f09 | 278 | lcd.drawSprite(50,i,7,9,(int *)arrow); |
AhmedPlaymaker | 4:1fe015b66bb8 | 279 | while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. |
AhmedPlaymaker | 3:fbb1fa853f09 | 280 | lcd.printString("SnakeVSBlock",5,0); |
AhmedPlaymaker | 3:fbb1fa853f09 | 281 | lcd.printString("Play",0,2); |
AhmedPlaymaker | 3:fbb1fa853f09 | 282 | lcd.printString("Settings",0,3); |
AhmedPlaymaker | 3:fbb1fa853f09 | 283 | lcd.printString("Stats",0,4); |
AhmedPlaymaker | 3:fbb1fa853f09 | 284 | lcd.printString("Tutorial",0,5); |
AhmedPlaymaker | 3:fbb1fa853f09 | 285 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 286 | if((d==N)&&(i>16)) { |
AhmedPlaymaker | 3:fbb1fa853f09 | 287 | i=i-8; |
AhmedPlaymaker | 3:fbb1fa853f09 | 288 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 289 | if((d==S)&&(i<40)) { |
AhmedPlaymaker | 3:fbb1fa853f09 | 290 | i=i+8; |
AhmedPlaymaker | 3:fbb1fa853f09 | 291 | } |
AhmedPlaymaker | 3:fbb1fa853f09 | 292 | lcd.drawSprite(50,i,7,9,(int *)arrow); //Function used to draw the sprite. |
AhmedPlaymaker | 3:fbb1fa853f09 | 293 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 294 | wait(1/cs); |
AhmedPlaymaker | 3:fbb1fa853f09 | 295 | lcd.clear(); |
AhmedPlaymaker | 3:fbb1fa853f09 | 296 | } |
AhmedPlaymaker | 6:3ffab44ed49c | 297 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 298 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 299 | if(i == 16) |
AhmedPlaymaker | 4:1fe015b66bb8 | 300 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 301 | menu_screen2(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 302 | } |
AhmedPlaymaker | 5:e4df87957a5b | 303 | else if(i == 24) |
AhmedPlaymaker | 5:e4df87957a5b | 304 | { |
AhmedPlaymaker | 5:e4df87957a5b | 305 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 306 | settings.info(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 307 | |
AhmedPlaymaker | 5:e4df87957a5b | 308 | while (pad.check_event(Gamepad::BACK_PRESSED) == false) { //if button pressed. |
AhmedPlaymaker | 5:e4df87957a5b | 309 | |
AhmedPlaymaker | 5:e4df87957a5b | 310 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 5:e4df87957a5b | 311 | wait(1/cs); |
AhmedPlaymaker | 5:e4df87957a5b | 312 | |
AhmedPlaymaker | 5:e4df87957a5b | 313 | if((d==E)&&(st==5)) { |
AhmedPlaymaker | 5:e4df87957a5b | 314 | st=1; |
AhmedPlaymaker | 5:e4df87957a5b | 315 | } |
AhmedPlaymaker | 5:e4df87957a5b | 316 | |
AhmedPlaymaker | 5:e4df87957a5b | 317 | else if((d==W)&&(st==1)) { |
AhmedPlaymaker | 5:e4df87957a5b | 318 | st=5; |
AhmedPlaymaker | 5:e4df87957a5b | 319 | } |
AhmedPlaymaker | 5:e4df87957a5b | 320 | |
AhmedPlaymaker | 5:e4df87957a5b | 321 | else if((d==E)&&(1<=st<=4)) { |
AhmedPlaymaker | 5:e4df87957a5b | 322 | st=st+1; |
AhmedPlaymaker | 5:e4df87957a5b | 323 | } |
AhmedPlaymaker | 5:e4df87957a5b | 324 | |
AhmedPlaymaker | 5:e4df87957a5b | 325 | else if((d==W)&&(2<=st<=5)) { |
AhmedPlaymaker | 5:e4df87957a5b | 326 | st=st-1; |
AhmedPlaymaker | 5:e4df87957a5b | 327 | } |
AhmedPlaymaker | 5:e4df87957a5b | 328 | |
AhmedPlaymaker | 5:e4df87957a5b | 329 | if(st==1) { |
AhmedPlaymaker | 5:e4df87957a5b | 330 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 331 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 332 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 333 | cs = settings.controlSensitivity(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 334 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 335 | } |
AhmedPlaymaker | 5:e4df87957a5b | 336 | if(st==2) { |
AhmedPlaymaker | 5:e4df87957a5b | 337 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 338 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 339 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 340 | settings.brigntness(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 341 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 342 | } |
AhmedPlaymaker | 5:e4df87957a5b | 343 | if(st==3) { |
AhmedPlaymaker | 5:e4df87957a5b | 344 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 345 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 346 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 347 | settings.contrast(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 348 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 349 | } |
AhmedPlaymaker | 5:e4df87957a5b | 350 | if(st==4) { |
AhmedPlaymaker | 5:e4df87957a5b | 351 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 352 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 353 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 354 | settings.volume(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 355 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 356 | } |
AhmedPlaymaker | 5:e4df87957a5b | 357 | if(st==5) { |
AhmedPlaymaker | 5:e4df87957a5b | 358 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 359 | lcd.drawSprite(5,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 360 | lcd.drawSprite(71,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 5:e4df87957a5b | 361 | sc = settings.showCredits(lcd, pad); |
AhmedPlaymaker | 5:e4df87957a5b | 362 | lcd.refresh(); |
AhmedPlaymaker | 5:e4df87957a5b | 363 | } |
AhmedPlaymaker | 5:e4df87957a5b | 364 | } |
AhmedPlaymaker | 5:e4df87957a5b | 365 | menu_screen1(lcd, pad); |
AhmedPlaymaker | 6:3ffab44ed49c | 366 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 5:e4df87957a5b | 367 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 368 | else |
AhmedPlaymaker | 4:1fe015b66bb8 | 369 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 370 | menu_screen1(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 371 | lr=1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 372 | } |
AhmedPlaymaker | 5:e4df87957a5b | 373 | |
AhmedPlaymaker | 3:fbb1fa853f09 | 374 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 375 | void StartScreen::menu_screen2(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 4:1fe015b66bb8 | 376 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 377 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 378 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 379 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 380 | while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. |
AhmedPlaymaker | 4:1fe015b66bb8 | 381 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 382 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 5:e4df87957a5b | 383 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 384 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 385 | if(((d==E)||(d==W))&&(lr==1)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 386 | lr=2; |
AhmedPlaymaker | 4:1fe015b66bb8 | 387 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 388 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 389 | else if(((d==E)||(d==W))&&(lr==2)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 390 | lr=1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 391 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 392 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 393 | if(lr==1) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 394 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 395 | lcd.drawRect(27,18,30,20,FILL_TRANSPARENT); |
AhmedPlaymaker | 4:1fe015b66bb8 | 396 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 397 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 398 | lcd.printString("Free Wave",14,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 399 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 400 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 401 | if(lr==2) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 402 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 403 | lcd.drawRect(27,18,30,20,FILL_TRANSPARENT); |
AhmedPlaymaker | 4:1fe015b66bb8 | 404 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 405 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 406 | lcd.printString("Bullet Shower",4,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 407 | lcd.drawSprite(29,19,13,5,(int *)bullet); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 408 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 409 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 410 | if (pad.check_event(Gamepad::BACK_PRESSED) == true) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 411 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 412 | menu_screen1(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 413 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 414 | } |
AhmedPlaymaker | 6:3ffab44ed49c | 415 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 416 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 417 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 418 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 419 | menu_screen3(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 420 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 421 | void StartScreen::menu_screen3(N5110 &lcd, Gamepad &pad) |
AhmedPlaymaker | 4:1fe015b66bb8 | 422 | { |
AhmedPlaymaker | 4:1fe015b66bb8 | 423 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 424 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 425 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 426 | while ((pad.check_event(Gamepad::JOY_PRESSED) == false)&&(pad.check_event(Gamepad::START_PRESSED) == false)) { //Change this to if button pressed. |
AhmedPlaymaker | 4:1fe015b66bb8 | 427 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 428 | Direction d = pad.get_direction(); |
AhmedPlaymaker | 5:e4df87957a5b | 429 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 430 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 431 | if((d==E)&&(gs==4)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 432 | gs=1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 433 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 434 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 435 | else if((d==W)&&(gs==1)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 436 | gs=4; |
AhmedPlaymaker | 4:1fe015b66bb8 | 437 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 438 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 439 | else if((d==E)&&(1<=gs<=3)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 440 | gs=gs+1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 441 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 442 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 443 | else if((d==W)&&(2<=gs<=4)) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 444 | gs=gs-1; |
AhmedPlaymaker | 4:1fe015b66bb8 | 445 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 446 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 447 | if(gs==1) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 448 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 449 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 450 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 451 | lcd.printString("Game Speed",10,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 452 | lcd.printString("SNAIL",26,3); |
AhmedPlaymaker | 4:1fe015b66bb8 | 453 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 454 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 455 | if(gs==2) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 456 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 457 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 458 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 459 | lcd.printString("Game Speed",10,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 460 | lcd.printString("TURTLE",24,3); |
AhmedPlaymaker | 4:1fe015b66bb8 | 461 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 462 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 463 | if(gs==3) { |
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("RABBIT",24,3); |
AhmedPlaymaker | 4:1fe015b66bb8 | 469 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 470 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 471 | if(gs==4) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 472 | lcd.clear(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 473 | lcd.drawSprite(10,22,13,8,(int *)navL); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 474 | lcd.drawSprite(65,22,13,8,(int *)navR); //Function used to draw the sprite. |
AhmedPlaymaker | 4:1fe015b66bb8 | 475 | lcd.printString("Game Speed",10,1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 476 | lcd.printString("CHEETHA",21,3); |
AhmedPlaymaker | 4:1fe015b66bb8 | 477 | lcd.refresh(); |
AhmedPlaymaker | 4:1fe015b66bb8 | 478 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 479 | |
AhmedPlaymaker | 4:1fe015b66bb8 | 480 | if (pad.check_event(Gamepad::BACK_PRESSED) == true) { |
AhmedPlaymaker | 4:1fe015b66bb8 | 481 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 482 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 483 | menu_screen2(lcd, pad); |
AhmedPlaymaker | 4:1fe015b66bb8 | 484 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 485 | } |
AhmedPlaymaker | 4:1fe015b66bb8 | 486 | |
AhmedPlaymaker | 6:3ffab44ed49c | 487 | pad.tone(1000.0,0.1); |
AhmedPlaymaker | 4:1fe015b66bb8 | 488 | lcd.clear(); |
AhmedPlaymaker | 5:e4df87957a5b | 489 | wait(1/cs); |
AhmedPlaymaker | 4:1fe015b66bb8 | 490 | } |