contains my game for the embedded systems project 2645
Dependencies: mbed FXOS8700CQQQ
Diff: GameEngine/RocketRacer.cpp
- Revision:
- 25:7e3b6df93dd5
- Parent:
- 24:a049cef2cc2e
- Child:
- 27:771d186b1bc8
diff -r a049cef2cc2e -r 7e3b6df93dd5 GameEngine/RocketRacer.cpp --- a/GameEngine/RocketRacer.cpp Fri Apr 19 22:10:51 2019 +0000 +++ b/GameEngine/RocketRacer.cpp Sat Apr 20 16:13:13 2019 +0000 @@ -1,5 +1,7 @@ #include "RocketRacer.h" + + //enemy sprite const int enemy[11][9] = { { 1,1,1,1,0,1,1,1,1 }, @@ -208,10 +210,25 @@ sprintf(buffer1,"%d",score); lcd.printString(buffer1,20,4); - pad.leds_on();//turns all leds on - pad.tone(4500,1);//makes a tone to indicate gmeover - + pad.leds_on();//turns all leds on lcd.refresh(); + End_Game_Melody(pad); + wait(500); + + + } + +void RocketRacer::End_Game_Melody(Gamepad &pad){ + pad.tone(300,1);//makes a tone to indicate gameover + wait(0.25); + pad.tone(450,1);//makes a tone to indicate gameover + wait(0.25); + pad.tone(300,1);//makes a tone to indicate gameover + wait(0.5); + pad.tone(450,1);//makes a tone to indicate gameover + wait(0.25); + pad.tone(300,1);//makes a tone to indicate gameover + wait(1); } \ No newline at end of file