contains my game for the embedded systems project 2645

Dependencies:   mbed FXOS8700CQQQ

Committer:
OmarAlebiary
Date:
Thu Apr 25 10:44:53 2019 +0000
Revision:
29:e660274d8222
Parent:
28:39607fb67e88
Child:
33:24ef796ff2c8
added doxygen comments

Who changed what in which revision?

UserRevisionLine numberNew contents of line
OmarAlebiary 28:39607fb67e88 1 #include "GameTones.h"
OmarAlebiary 28:39607fb67e88 2
OmarAlebiary 29:e660274d8222 3 //default constructor
OmarAlebiary 28:39607fb67e88 4 GameTones::GameTones(){
OmarAlebiary 28:39607fb67e88 5 }
OmarAlebiary 28:39607fb67e88 6
OmarAlebiary 29:e660274d8222 7 GameTones::~GameTones(){
OmarAlebiary 29:e660274d8222 8 }
OmarAlebiary 28:39607fb67e88 9
OmarAlebiary 28:39607fb67e88 10 void GameTones::End_Game_Melody(Gamepad &pad){
OmarAlebiary 28:39607fb67e88 11 pad.tone(300,1);//makes a tone to indicate gameover
OmarAlebiary 28:39607fb67e88 12 wait(0.25);
OmarAlebiary 28:39607fb67e88 13 pad.tone(450,1);//makes a tone to indicate gameover
OmarAlebiary 28:39607fb67e88 14 wait(0.25);
OmarAlebiary 28:39607fb67e88 15 pad.tone(300,1);//makes a tone to indicate gameover
OmarAlebiary 28:39607fb67e88 16 wait(0.5);
OmarAlebiary 28:39607fb67e88 17 pad.tone(450,1);//makes a tone to indicate gameover
OmarAlebiary 28:39607fb67e88 18 wait(0.25);
OmarAlebiary 28:39607fb67e88 19 pad.tone(300,1);//makes a tone to indicate gameover
OmarAlebiary 28:39607fb67e88 20 wait(1);
OmarAlebiary 28:39607fb67e88 21 }
OmarAlebiary 28:39607fb67e88 22
OmarAlebiary 28:39607fb67e88 23
OmarAlebiary 28:39607fb67e88 24 void GameTones::Play_Welcome_Melody(Gamepad &pad) {
OmarAlebiary 28:39607fb67e88 25 pad.tone(500, 1);//plays a tone at frequency 500hz
OmarAlebiary 28:39607fb67e88 26 wait(0.5);
OmarAlebiary 28:39607fb67e88 27 pad.tone(300, 2); //plays a tone at frequency 300hz
OmarAlebiary 28:39607fb67e88 28 wait(0.5);
OmarAlebiary 28:39607fb67e88 29 pad.tone(400, 2); //plays a tone at frequency 400hz
OmarAlebiary 28:39607fb67e88 30 wait(1.5);
OmarAlebiary 28:39607fb67e88 31 pad.tone(450, 0.2);//plays a tone at frequency 450hz
OmarAlebiary 28:39607fb67e88 32 wait(0.25);
OmarAlebiary 28:39607fb67e88 33 pad.tone(400, 0.2); //plays a tone at frequency 400hz
OmarAlebiary 28:39607fb67e88 34 wait(1);
OmarAlebiary 28:39607fb67e88 35
OmarAlebiary 28:39607fb67e88 36 }