![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
contains my game for the embedded systems project 2645
Dependencies: mbed FXOS8700CQQQ
Diff: GameEngine/RocketRacer.cpp
- Revision:
- 20:1907ef5d29bb
- Parent:
- 19:ad9dc8e418c9
- Child:
- 21:5c98996d1487
diff -r ad9dc8e418c9 -r 1907ef5d29bb GameEngine/RocketRacer.cpp --- a/GameEngine/RocketRacer.cpp Tue Apr 09 15:33:52 2019 +0000 +++ b/GameEngine/RocketRacer.cpp Sun Apr 14 10:56:24 2019 +0000 @@ -1,8 +1,6 @@ #include "RocketRacer.h" - - const int enemy[11][9] = { { 0,0,0,0,1,0,0,0,0 }, { 0,0,0,1,1,1,0,0,0 }, @@ -134,37 +132,25 @@ //adds difficulty to the game after proceeding with each level void RocketRacer::Game_difficulty(Gamepad &pad){ - if (score>=0 && score<=5){ - pad.led(1,1.0); - game_speed = 1; + pad.led(1,1.0); game_speed = 1; wait(0.09); - } - if (score>5 && score<=10){ - pad.led(2,1.0); - game_speed = 2; + }if (score>5 && score<=10){ + pad.led(2,1.0); game_speed = 2; wait(0.07); - } - if (score>10 && score<=20){ - pad.led(3,1.0); - game_speed = 3; + }if (score>10 && score<=20){ + pad.led(3,1.0); game_speed = 3; wait(0.06); - } - if (score>20 && score<=25){ - pad.led(4,1.0); - game_speed = 4; + }if (score>20 && score<=25){ + pad.led(4,1.0); game_speed = 4; wait(0.05); - } - if (score>25 && score<=30){ - pad.led(5,1.0); - game_speed = 5; + }if (score>25 && score<=30){ + pad.led(5,1.0); game_speed = 5; wait(0.04); - } - if (score>30){ - pad.led(6,1.0); - game_speed = 6; + }if (score>30){ + pad.led(6,1.0); game_speed = 6; wait(0.03); - } + } }