![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
contains my game for the embedded systems project 2645
Dependencies: mbed FXOS8700CQQQ
GameTones/GameTones.cpp@28:39607fb67e88, 2019-04-24 (annotated)
- Committer:
- OmarAlebiary
- Date:
- Wed Apr 24 10:19:07 2019 +0000
- Revision:
- 28:39607fb67e88
- Child:
- 29:e660274d8222
added doxygen comments to RocketRacer.h
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
OmarAlebiary | 28:39607fb67e88 | 1 | #include "GameTones.h" |
OmarAlebiary | 28:39607fb67e88 | 2 | |
OmarAlebiary | 28:39607fb67e88 | 3 | |
OmarAlebiary | 28:39607fb67e88 | 4 | GameTones::GameTones(){ |
OmarAlebiary | 28:39607fb67e88 | 5 | } |
OmarAlebiary | 28:39607fb67e88 | 6 | |
OmarAlebiary | 28:39607fb67e88 | 7 | |
OmarAlebiary | 28:39607fb67e88 | 8 | void GameTones::End_Game_Melody(Gamepad &pad){ |
OmarAlebiary | 28:39607fb67e88 | 9 | pad.tone(300,1);//makes a tone to indicate gameover |
OmarAlebiary | 28:39607fb67e88 | 10 | wait(0.25); |
OmarAlebiary | 28:39607fb67e88 | 11 | pad.tone(450,1);//makes a tone to indicate gameover |
OmarAlebiary | 28:39607fb67e88 | 12 | wait(0.25); |
OmarAlebiary | 28:39607fb67e88 | 13 | pad.tone(300,1);//makes a tone to indicate gameover |
OmarAlebiary | 28:39607fb67e88 | 14 | wait(0.5); |
OmarAlebiary | 28:39607fb67e88 | 15 | pad.tone(450,1);//makes a tone to indicate gameover |
OmarAlebiary | 28:39607fb67e88 | 16 | wait(0.25); |
OmarAlebiary | 28:39607fb67e88 | 17 | pad.tone(300,1);//makes a tone to indicate gameover |
OmarAlebiary | 28:39607fb67e88 | 18 | wait(1); |
OmarAlebiary | 28:39607fb67e88 | 19 | } |
OmarAlebiary | 28:39607fb67e88 | 20 | |
OmarAlebiary | 28:39607fb67e88 | 21 | |
OmarAlebiary | 28:39607fb67e88 | 22 | void GameTones::Play_Welcome_Melody(Gamepad &pad) { |
OmarAlebiary | 28:39607fb67e88 | 23 | pad.tone(500, 1);//plays a tone at frequency 500hz |
OmarAlebiary | 28:39607fb67e88 | 24 | wait(0.5); |
OmarAlebiary | 28:39607fb67e88 | 25 | pad.tone(300, 2); //plays a tone at frequency 300hz |
OmarAlebiary | 28:39607fb67e88 | 26 | wait(0.5); |
OmarAlebiary | 28:39607fb67e88 | 27 | pad.tone(400, 2); //plays a tone at frequency 400hz |
OmarAlebiary | 28:39607fb67e88 | 28 | wait(1.5); |
OmarAlebiary | 28:39607fb67e88 | 29 | pad.tone(450, 0.2);//plays a tone at frequency 450hz |
OmarAlebiary | 28:39607fb67e88 | 30 | wait(0.25); |
OmarAlebiary | 28:39607fb67e88 | 31 | pad.tone(400, 0.2); //plays a tone at frequency 400hz |
OmarAlebiary | 28:39607fb67e88 | 32 | wait(1); |
OmarAlebiary | 28:39607fb67e88 | 33 | |
OmarAlebiary | 28:39607fb67e88 | 34 | } |