![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Game codes for Pokemon Academy Yiu Fai Kwok - 201198802 I have read the University Regulations on Plagiarism and state that the work covered by this declaration is my own and does not contain any unacknowledged work from other sources.
Dependencies: mbed FXOS8700CQ mbed-rtos
Titles/Titles.h@34:3ddfaa217eca, 2019-05-09 (annotated)
- Committer:
- yfkwok
- Date:
- Thu May 09 00:41:05 2019 +0000
- Revision:
- 34:3ddfaa217eca
- Parent:
- 33:f7ec806e14b6
09/05/2019 - Last commit before submission
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yfkwok | 33:f7ec806e14b6 | 1 | #ifndef TITLES_H |
yfkwok | 33:f7ec806e14b6 | 2 | #define TITLES_H |
yfkwok | 33:f7ec806e14b6 | 3 | |
yfkwok | 33:f7ec806e14b6 | 4 | #include "mbed.h" |
yfkwok | 33:f7ec806e14b6 | 5 | #include "N5110.h" |
yfkwok | 33:f7ec806e14b6 | 6 | #include "Gamepad.h" |
yfkwok | 33:f7ec806e14b6 | 7 | #include "Score.h" |
yfkwok | 33:f7ec806e14b6 | 8 | |
yfkwok | 33:f7ec806e14b6 | 9 | /** Titles Class |
yfkwok | 33:f7ec806e14b6 | 10 | * @brief This class contains the main functions to draw all the title screens for different main pages of the game |
yfkwok | 33:f7ec806e14b6 | 11 | * @version 1.0 |
yfkwok | 33:f7ec806e14b6 | 12 | * @author Yiu Fai Kwok |
yfkwok | 33:f7ec806e14b6 | 13 | * @date April, 2019 |
yfkwok | 33:f7ec806e14b6 | 14 | */ |
yfkwok | 33:f7ec806e14b6 | 15 | |
yfkwok | 33:f7ec806e14b6 | 16 | class Titles |
yfkwok | 33:f7ec806e14b6 | 17 | { |
yfkwok | 33:f7ec806e14b6 | 18 | |
yfkwok | 33:f7ec806e14b6 | 19 | public: |
yfkwok | 33:f7ec806e14b6 | 20 | /** Constructor */ |
yfkwok | 33:f7ec806e14b6 | 21 | Titles(); |
yfkwok | 33:f7ec806e14b6 | 22 | /** Deconstructor */ |
yfkwok | 33:f7ec806e14b6 | 23 | ~Titles(); |
yfkwok | 33:f7ec806e14b6 | 24 | |
yfkwok | 33:f7ec806e14b6 | 25 | /** |
yfkwok | 33:f7ec806e14b6 | 26 | * @brief Welcome function for Main Title |
yfkwok | 33:f7ec806e14b6 | 27 | * @details The function draws the main title sprite, plays the background music and instruct player to press start button |
yfkwok | 33:f7ec806e14b6 | 28 | */ |
yfkwok | 33:f7ec806e14b6 | 29 | void welcome(Gamepad &pad, N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 30 | |
yfkwok | 33:f7ec806e14b6 | 31 | /** |
yfkwok | 33:f7ec806e14b6 | 32 | * @brief Grad title |
yfkwok | 33:f7ec806e14b6 | 33 | * @param character cha (int) |
yfkwok | 33:f7ec806e14b6 | 34 | * @details The function draws the graduation title and plays the music to the graduation |
yfkwok | 33:f7ec806e14b6 | 35 | */ |
yfkwok | 33:f7ec806e14b6 | 36 | void Grad_title(Gamepad &pad, N5110 &lcd, int cha); |
yfkwok | 33:f7ec806e14b6 | 37 | |
yfkwok | 33:f7ec806e14b6 | 38 | /** |
yfkwok | 33:f7ec806e14b6 | 39 | * @brief Year One Title |
yfkwok | 33:f7ec806e14b6 | 40 | * @details The function draws the year one title sprite, plays the background music for level up |
yfkwok | 33:f7ec806e14b6 | 41 | */ |
yfkwok | 33:f7ec806e14b6 | 42 | void year_one(Gamepad &pad, N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 43 | |
yfkwok | 33:f7ec806e14b6 | 44 | /** |
yfkwok | 33:f7ec806e14b6 | 45 | * @brief Year Two Title |
yfkwok | 33:f7ec806e14b6 | 46 | * @details The function draws the year two title sprite, plays the background music for level up |
yfkwok | 33:f7ec806e14b6 | 47 | */ |
yfkwok | 33:f7ec806e14b6 | 48 | void year_two(Gamepad &pad, N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 49 | |
yfkwok | 33:f7ec806e14b6 | 50 | /** |
yfkwok | 33:f7ec806e14b6 | 51 | * @brief Year Three Title |
yfkwok | 33:f7ec806e14b6 | 52 | * @details The function draws the year three title sprite, plays the background music for level up |
yfkwok | 33:f7ec806e14b6 | 53 | */ |
yfkwok | 33:f7ec806e14b6 | 54 | void year_three(Gamepad &pad, N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 55 | |
yfkwok | 33:f7ec806e14b6 | 56 | /** |
yfkwok | 33:f7ec806e14b6 | 57 | * @brief Term One Title |
yfkwok | 33:f7ec806e14b6 | 58 | * @details The function draws the term one title sprite, plays the background music for level up |
yfkwok | 33:f7ec806e14b6 | 59 | */ |
yfkwok | 33:f7ec806e14b6 | 60 | void term_one(Gamepad &pad, N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 61 | |
yfkwok | 33:f7ec806e14b6 | 62 | /** |
yfkwok | 33:f7ec806e14b6 | 63 | * @brief Term Two Title |
yfkwok | 33:f7ec806e14b6 | 64 | * @details The function draws the term two title sprite, plays the background music for level up |
yfkwok | 33:f7ec806e14b6 | 65 | */ |
yfkwok | 33:f7ec806e14b6 | 66 | void term_two(Gamepad &pad, N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 67 | |
yfkwok | 33:f7ec806e14b6 | 68 | /** |
yfkwok | 33:f7ec806e14b6 | 69 | * @brief Term Three Title |
yfkwok | 33:f7ec806e14b6 | 70 | * @details The function draws the term three title sprite, plays the background music for level up |
yfkwok | 33:f7ec806e14b6 | 71 | */ |
yfkwok | 33:f7ec806e14b6 | 72 | void term_three(Gamepad &pad, N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 73 | |
yfkwok | 33:f7ec806e14b6 | 74 | /** |
yfkwok | 33:f7ec806e14b6 | 75 | * @brief Win Title |
yfkwok | 33:f7ec806e14b6 | 76 | * @details The function draws the win title sprite when player wins the mission |
yfkwok | 33:f7ec806e14b6 | 77 | */ |
yfkwok | 33:f7ec806e14b6 | 78 | void win(N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 79 | |
yfkwok | 33:f7ec806e14b6 | 80 | /** |
yfkwok | 33:f7ec806e14b6 | 81 | * @brief Lose Title |
yfkwok | 33:f7ec806e14b6 | 82 | * @details The function draws the lose title sprite when player loses the mission |
yfkwok | 33:f7ec806e14b6 | 83 | */ |
yfkwok | 33:f7ec806e14b6 | 84 | void lose(N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 85 | |
yfkwok | 33:f7ec806e14b6 | 86 | /** |
yfkwok | 33:f7ec806e14b6 | 87 | * @brief Pass Title |
yfkwok | 33:f7ec806e14b6 | 88 | * @details The function draws the pass title sprite when player passes the exam |
yfkwok | 33:f7ec806e14b6 | 89 | */ |
yfkwok | 33:f7ec806e14b6 | 90 | void passed(N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 91 | |
yfkwok | 33:f7ec806e14b6 | 92 | /** |
yfkwok | 33:f7ec806e14b6 | 93 | * @brief Fail Title |
yfkwok | 33:f7ec806e14b6 | 94 | * @details The function draws the Fail title sprite when player fails the exam |
yfkwok | 33:f7ec806e14b6 | 95 | */ |
yfkwok | 33:f7ec806e14b6 | 96 | void failed(N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 97 | |
yfkwok | 33:f7ec806e14b6 | 98 | /** |
yfkwok | 33:f7ec806e14b6 | 99 | * @brief Fail Title |
yfkwok | 33:f7ec806e14b6 | 100 | * @details The function draws the Fail title sprite when player fails the exam |
yfkwok | 33:f7ec806e14b6 | 101 | */ |
yfkwok | 33:f7ec806e14b6 | 102 | void instruction(Gamepad &pad, N5110 &lcd); |
yfkwok | 33:f7ec806e14b6 | 103 | |
yfkwok | 33:f7ec806e14b6 | 104 | private: |
yfkwok | 33:f7ec806e14b6 | 105 | |
yfkwok | 33:f7ec806e14b6 | 106 | Score music; |
yfkwok | 33:f7ec806e14b6 | 107 | |
yfkwok | 33:f7ec806e14b6 | 108 | }; |
yfkwok | 33:f7ec806e14b6 | 109 | |
yfkwok | 33:f7ec806e14b6 | 110 | #endif |