contains my game for the embedded systems project 2645

Dependencies:   mbed FXOS8700CQQQ

Committer:
OmarAlebiary
Date:
Tue May 07 15:17:21 2019 +0000
Revision:
40:13b8467526d0
Parent:
33:24ef796ff2c8
Final Submission. I have read and agreed with Statement of Academic Integrity

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 33:24ef796ff2c8 6 // destructor of the class
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 33:24ef796ff2c8 26 wait(0.5);//small delay
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 }