![](/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
Game_one/Game_one.h@4:5bc9c4363d31, 2019-04-03 (annotated)
- Committer:
- yfkwok
- Date:
- Wed Apr 03 18:40:43 2019 +0000
- Revision:
- 4:5bc9c4363d31
- Parent:
- 2:464c7e62d97d
- Child:
- 17:5d8ff39a0e49
3/4/2019 - Created evolution music and animation for Squirtle
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yfkwok | 2:464c7e62d97d | 1 | #ifndef GAME_ONE_H |
yfkwok | 2:464c7e62d97d | 2 | #define GAME_ONE_H |
yfkwok | 2:464c7e62d97d | 3 | |
yfkwok | 2:464c7e62d97d | 4 | #include "mbed.h" |
yfkwok | 2:464c7e62d97d | 5 | #include "N5110.h" |
yfkwok | 2:464c7e62d97d | 6 | #include "Gamepad.h" |
yfkwok | 2:464c7e62d97d | 7 | #include "Coin.h" |
yfkwok | 2:464c7e62d97d | 8 | #include "Object.h" |
yfkwok | 2:464c7e62d97d | 9 | #include "Game_one_cha.h" |
yfkwok | 2:464c7e62d97d | 10 | #include "Score.h" |
yfkwok | 2:464c7e62d97d | 11 | |
yfkwok | 2:464c7e62d97d | 12 | class Game_one |
yfkwok | 2:464c7e62d97d | 13 | { |
yfkwok | 2:464c7e62d97d | 14 | |
yfkwok | 2:464c7e62d97d | 15 | public: |
yfkwok | 2:464c7e62d97d | 16 | Game_one(); |
yfkwok | 2:464c7e62d97d | 17 | ~Game_one(); |
yfkwok | 2:464c7e62d97d | 18 | |
yfkwok | 2:464c7e62d97d | 19 | void init(int speed, int cha, int r); |
yfkwok | 2:464c7e62d97d | 20 | void render(N5110 &lcd, int cha); |
yfkwok | 2:464c7e62d97d | 21 | void read_input(Gamepad &pad); |
yfkwok | 2:464c7e62d97d | 22 | void update(Gamepad &pad, N5110 &lcd); |
yfkwok | 2:464c7e62d97d | 23 | void draw(N5110 &lcd, int cha); |
yfkwok | 2:464c7e62d97d | 24 | int get_count(); |
yfkwok | 2:464c7e62d97d | 25 | int update_alt(); |
yfkwok | 2:464c7e62d97d | 26 | void set_alt(int alt); |
yfkwok | 2:464c7e62d97d | 27 | int print_scores(N5110 &lcd); |
yfkwok | 4:5bc9c4363d31 | 28 | void intro(Gamepad &pad, N5110 &lcd); |
yfkwok | 2:464c7e62d97d | 29 | |
yfkwok | 2:464c7e62d97d | 30 | private: |
yfkwok | 2:464c7e62d97d | 31 | |
yfkwok | 2:464c7e62d97d | 32 | void check_player_collect(Gamepad &pad); |
yfkwok | 2:464c7e62d97d | 33 | void check_player_collide(Gamepad &pad, N5110 &lcd); |
yfkwok | 2:464c7e62d97d | 34 | void check_miss_coin(Gamepad &pad); |
yfkwok | 2:464c7e62d97d | 35 | void check_miss_block(Gamepad &pad); |
yfkwok | 2:464c7e62d97d | 36 | void gameover(N5110 &lcd, Gamepad &pad); |
yfkwok | 2:464c7e62d97d | 37 | void set_count(int count); |
yfkwok | 2:464c7e62d97d | 38 | |
yfkwok | 2:464c7e62d97d | 39 | Score music; |
yfkwok | 2:464c7e62d97d | 40 | Game_one_cha _p1; |
yfkwok | 2:464c7e62d97d | 41 | |
yfkwok | 2:464c7e62d97d | 42 | int _speed; |
yfkwok | 2:464c7e62d97d | 43 | int _cha; |
yfkwok | 2:464c7e62d97d | 44 | int _rand; |
yfkwok | 2:464c7e62d97d | 45 | |
yfkwok | 2:464c7e62d97d | 46 | // x positions of the player |
yfkwok | 2:464c7e62d97d | 47 | int _p1x; |
yfkwok | 2:464c7e62d97d | 48 | |
yfkwok | 2:464c7e62d97d | 49 | Coin _coin; |
yfkwok | 2:464c7e62d97d | 50 | Object _block; |
yfkwok | 2:464c7e62d97d | 51 | |
yfkwok | 2:464c7e62d97d | 52 | Direction _d; |
yfkwok | 2:464c7e62d97d | 53 | float _mag; |
yfkwok | 2:464c7e62d97d | 54 | int _count; |
yfkwok | 2:464c7e62d97d | 55 | int _alt; |
yfkwok | 2:464c7e62d97d | 56 | int _type; |
yfkwok | 2:464c7e62d97d | 57 | |
yfkwok | 2:464c7e62d97d | 58 | }; |
yfkwok | 2:464c7e62d97d | 59 | |
yfkwok | 2:464c7e62d97d | 60 | #endif |