The game is finished
Dependencies: mbed Gamepad N5110 mbed-rtos
Music/Music.cpp@5:016a7315b75d, 2019-05-06 (annotated)
- Committer:
- RexRoshan
- Date:
- Mon May 06 18:29:49 2019 +0000
- Revision:
- 5:016a7315b75d
- Parent:
- 0:99fa5a619081
- Child:
- 6:1fcfd331c047
Commented almost every class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RexRoshan | 0:99fa5a619081 | 1 | #include "Music.h" |
RexRoshan | 0:99fa5a619081 | 2 | |
RexRoshan | 0:99fa5a619081 | 3 | Music::Music() |
RexRoshan | 0:99fa5a619081 | 4 | { |
RexRoshan | 0:99fa5a619081 | 5 | |
RexRoshan | 0:99fa5a619081 | 6 | } |
RexRoshan | 0:99fa5a619081 | 7 | |
RexRoshan | 0:99fa5a619081 | 8 | Music::~Music() |
RexRoshan | 0:99fa5a619081 | 9 | { |
RexRoshan | 0:99fa5a619081 | 10 | |
RexRoshan | 0:99fa5a619081 | 11 | } |
RexRoshan | 0:99fa5a619081 | 12 | |
RexRoshan | 5:016a7315b75d | 13 | void Music::intro_song(Gamepad &pad) // introduction song for the game |
RexRoshan | 0:99fa5a619081 | 14 | { |
RexRoshan | 5:016a7315b75d | 15 | while(pad.check_event(Gamepad::START_PRESSED) == false){ |
RexRoshan | 5:016a7315b75d | 16 | pad.tone(293.665, 2); |
RexRoshan | 5:016a7315b75d | 17 | Thread.wait(1000); // thread wait so that two loops can simulatneously run |
RexRoshan | 5:016a7315b75d | 18 | if(pad.check_event(Gamepad::START_PRESSED) == true){break;} // break if start button has been pressed |
RexRoshan | 0:99fa5a619081 | 19 | pad.tone(311.127, 2); |
RexRoshan | 0:99fa5a619081 | 20 | Thread.wait(1000); |
RexRoshan | 0:99fa5a619081 | 21 | if(pad.check_event(Gamepad::START_PRESSED) == true){break;} |
RexRoshan | 0:99fa5a619081 | 22 | pad.tone(329.628, 2); |
RexRoshan | 0:99fa5a619081 | 23 | Thread.wait(1000); |
RexRoshan | 0:99fa5a619081 | 24 | if(pad.check_event(Gamepad::START_PRESSED) == true){break;} |
RexRoshan | 0:99fa5a619081 | 25 | pad.tone(349.228, 2); |
RexRoshan | 0:99fa5a619081 | 26 | Thread.wait(1000); |
RexRoshan | 0:99fa5a619081 | 27 | if(pad.check_event(Gamepad::START_PRESSED) == true){break;} |
RexRoshan | 0:99fa5a619081 | 28 | } |
RexRoshan | 0:99fa5a619081 | 29 | } |
RexRoshan | 0:99fa5a619081 | 30 |