Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed FXOS8700CQ mbed-rtos
Score/Score.h@30:0ff3bede5307, 2019-05-06 (annotated)
- Committer:
- yfkwok
- Date:
- Mon May 06 20:37:23 2019 +0000
- Revision:
- 30:0ff3bede5307
- Parent:
- 17:5d8ff39a0e49
All 3 mini games for characters completed with documentations
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yfkwok | 2:464c7e62d97d | 1 | #ifndef SCORE_H |
yfkwok | 2:464c7e62d97d | 2 | #define SCORE_H |
yfkwok | 2:464c7e62d97d | 3 | |
yfkwok | 2:464c7e62d97d | 4 | #include "Gamepad.h" |
yfkwok | 2:464c7e62d97d | 5 | #include "mbed.h" |
yfkwok | 2:464c7e62d97d | 6 | #include "Notes.h" |
yfkwok | 4:5bc9c4363d31 | 7 | #include "N5110.h" |
yfkwok | 4:5bc9c4363d31 | 8 | #include "Squirtle.h" |
yfkwok | 10:adff3c804985 | 9 | #include "Charmander.h" |
yfkwok | 12:71683453f66a | 10 | #include "Bulbasaur.h" |
yfkwok | 2:464c7e62d97d | 11 | |
yfkwok | 16:4e49f5cb972e | 12 | /** Score Class |
yfkwok | 16:4e49f5cb972e | 13 | * @author Yiu Fai Kwok, University of Leeds |
yfkwok | 16:4e49f5cb972e | 14 | * @version 1.0 |
yfkwok | 16:4e49f5cb972e | 15 | * @brief Score class containing all in-game background music files |
yfkwok | 16:4e49f5cb972e | 16 | * @date 20/04/2019 |
yfkwok | 16:4e49f5cb972e | 17 | */ |
yfkwok | 16:4e49f5cb972e | 18 | |
yfkwok | 2:464c7e62d97d | 19 | class Score |
yfkwok | 2:464c7e62d97d | 20 | { |
yfkwok | 2:464c7e62d97d | 21 | public: |
yfkwok | 16:4e49f5cb972e | 22 | |
yfkwok | 16:4e49f5cb972e | 23 | /** Constructor */ |
yfkwok | 2:464c7e62d97d | 24 | Score(); |
yfkwok | 16:4e49f5cb972e | 25 | /** Deconstructor */ |
yfkwok | 2:464c7e62d97d | 26 | ~Score(); |
yfkwok | 16:4e49f5cb972e | 27 | |
yfkwok | 16:4e49f5cb972e | 28 | /** |
yfkwok | 16:4e49f5cb972e | 29 | * @brief Title screen music |
yfkwok | 16:4e49f5cb972e | 30 | * @details Background music played during title screen |
yfkwok | 16:4e49f5cb972e | 31 | */ |
yfkwok | 2:464c7e62d97d | 32 | void title_music(Gamepad &pad); |
yfkwok | 16:4e49f5cb972e | 33 | |
yfkwok | 16:4e49f5cb972e | 34 | /** |
yfkwok | 16:4e49f5cb972e | 35 | * @brief Level up music |
yfkwok | 16:4e49f5cb972e | 36 | * @details Background music played when player advance in level or year |
yfkwok | 16:4e49f5cb972e | 37 | */ |
yfkwok | 2:464c7e62d97d | 38 | void level_up(Gamepad &pad); |
yfkwok | 16:4e49f5cb972e | 39 | |
yfkwok | 16:4e49f5cb972e | 40 | /** |
yfkwok | 16:4e49f5cb972e | 41 | * @brief Congratulation music |
yfkwok | 16:4e49f5cb972e | 42 | * @details Background music played when player succesfully completed a mission |
yfkwok | 16:4e49f5cb972e | 43 | */ |
yfkwok | 2:464c7e62d97d | 44 | void congrats(Gamepad &pad); |
yfkwok | 16:4e49f5cb972e | 45 | |
yfkwok | 16:4e49f5cb972e | 46 | /** |
yfkwok | 16:4e49f5cb972e | 47 | * @brief Coin music |
yfkwok | 16:4e49f5cb972e | 48 | * @details Background music played when player successfully collected a coin in Game 1 |
yfkwok | 16:4e49f5cb972e | 49 | */ |
yfkwok | 2:464c7e62d97d | 50 | void coin(Gamepad &pad); |
yfkwok | 16:4e49f5cb972e | 51 | |
yfkwok | 16:4e49f5cb972e | 52 | /** |
yfkwok | 16:4e49f5cb972e | 53 | * @brief Evolution animation and music |
yfkwok | 17:5d8ff39a0e49 | 54 | * @param character cha (int) |
yfkwok | 17:5d8ff39a0e49 | 55 | * @param the value of year (int) |
yfkwok | 16:4e49f5cb972e | 56 | * @details Background music played when player's character enters evolution, dependent on character selected (cha) and year of which player is currently in (year), initiate animation for evolution. |
yfkwok | 16:4e49f5cb972e | 57 | */ |
yfkwok | 4:5bc9c4363d31 | 58 | void evolution_music(Gamepad &pad, N5110 &lcd, int cha, int year); |
yfkwok | 16:4e49f5cb972e | 59 | |
yfkwok | 16:4e49f5cb972e | 60 | /** |
yfkwok | 16:4e49f5cb972e | 61 | * @brief Congratulation music for evolution |
yfkwok | 16:4e49f5cb972e | 62 | * @details Background music played when player's character succesfully evolves, draw sprite of the evolved character |
yfkwok | 16:4e49f5cb972e | 63 | */ |
yfkwok | 4:5bc9c4363d31 | 64 | void congrats(Gamepad &pad, N5110 &lcd, int cha, int year); |
yfkwok | 16:4e49f5cb972e | 65 | |
yfkwok | 16:4e49f5cb972e | 66 | /** |
yfkwok | 16:4e49f5cb972e | 67 | * @brief Draw sprite of pokemon |
yfkwok | 17:5d8ff39a0e49 | 68 | * @param character cha (int) |
yfkwok | 17:5d8ff39a0e49 | 69 | * @param the value of year (int) |
yfkwok | 17:5d8ff39a0e49 | 70 | * @param the value of x (int) |
yfkwok | 17:5d8ff39a0e49 | 71 | * @param the value of y (int) |
yfkwok | 16:4e49f5cb972e | 72 | * @details Draw sprite of character depending on character selected (cha) and the year at which the player is in (year). Location of the sprite is determined by x and y to generate the moving name title. |
yfkwok | 16:4e49f5cb972e | 73 | */ |
yfkwok | 12:71683453f66a | 74 | void draw(N5110 &lcd, int cha, int year, int x, int y); |
yfkwok | 16:4e49f5cb972e | 75 | |
yfkwok | 16:4e49f5cb972e | 76 | /** |
yfkwok | 16:4e49f5cb972e | 77 | * @brief Draw sprite of evolved pokemon |
yfkwok | 17:5d8ff39a0e49 | 78 | * @param character cha (int) |
yfkwok | 17:5d8ff39a0e49 | 79 | * @param the value of year (int) |
yfkwok | 16:4e49f5cb972e | 80 | * @details Draw sprite of evolved character according to year (year) and character selected (cha) |
yfkwok | 16:4e49f5cb972e | 81 | */ |
yfkwok | 4:5bc9c4363d31 | 82 | void draw_cong(N5110 &lcd, int cha, int year); |
yfkwok | 16:4e49f5cb972e | 83 | |
yfkwok | 16:4e49f5cb972e | 84 | /** |
yfkwok | 16:4e49f5cb972e | 85 | * @brief Music for winning |
yfkwok | 16:4e49f5cb972e | 86 | * @details Background music played when player wins a mini game |
yfkwok | 16:4e49f5cb972e | 87 | */ |
yfkwok | 5:bc0691d02fd5 | 88 | void win(Gamepad &pad); |
yfkwok | 16:4e49f5cb972e | 89 | |
yfkwok | 16:4e49f5cb972e | 90 | /** |
yfkwok | 16:4e49f5cb972e | 91 | * @brief Music for EXAM introduction |
yfkwok | 16:4e49f5cb972e | 92 | * @details Background music played when player enters the EXAM |
yfkwok | 16:4e49f5cb972e | 93 | */ |
yfkwok | 5:bc0691d02fd5 | 94 | void exam_intro(Gamepad &pad); |
yfkwok | 16:4e49f5cb972e | 95 | |
yfkwok | 16:4e49f5cb972e | 96 | /** |
yfkwok | 16:4e49f5cb972e | 97 | * @brief Music for EXAM running in parallel to the exam |
yfkwok | 17:5d8ff39a0e49 | 98 | * @param state (bool) |
yfkwok | 17:5d8ff39a0e49 | 99 | * @details Background music played during the EXAM, stops when the boolean variable state becomes false |
yfkwok | 16:4e49f5cb972e | 100 | */ |
yfkwok | 5:bc0691d02fd5 | 101 | void gym(Gamepad &pad, bool state); |
yfkwok | 2:464c7e62d97d | 102 | |
yfkwok | 2:464c7e62d97d | 103 | private: |
yfkwok | 4:5bc9c4363d31 | 104 | Squirtle _s1; |
yfkwok | 10:adff3c804985 | 105 | Charmander _c1; |
yfkwok | 12:71683453f66a | 106 | Bulbasaur _b1; |
yfkwok | 2:464c7e62d97d | 107 | }; |
yfkwok | 2:464c7e62d97d | 108 | #endif |