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

Committer:
yfkwok
Date:
Wed Apr 03 03:06:00 2019 +0000
Revision:
2:464c7e62d97d
Child:
4:5bc9c4363d31
Date 3/4/2019 - Mini game one beta complete

Who changed what in which revision?

UserRevisionLine numberNew 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 2:464c7e62d97d 28
yfkwok 2:464c7e62d97d 29 private:
yfkwok 2:464c7e62d97d 30
yfkwok 2:464c7e62d97d 31 void check_player_collect(Gamepad &pad);
yfkwok 2:464c7e62d97d 32 void check_player_collide(Gamepad &pad, N5110 &lcd);
yfkwok 2:464c7e62d97d 33 void check_miss_coin(Gamepad &pad);
yfkwok 2:464c7e62d97d 34 void check_miss_block(Gamepad &pad);
yfkwok 2:464c7e62d97d 35 void gameover(N5110 &lcd, Gamepad &pad);
yfkwok 2:464c7e62d97d 36 void set_count(int count);
yfkwok 2:464c7e62d97d 37
yfkwok 2:464c7e62d97d 38 Score music;
yfkwok 2:464c7e62d97d 39 Game_one_cha _p1;
yfkwok 2:464c7e62d97d 40
yfkwok 2:464c7e62d97d 41 int _speed;
yfkwok 2:464c7e62d97d 42 int _cha;
yfkwok 2:464c7e62d97d 43 int _rand;
yfkwok 2:464c7e62d97d 44
yfkwok 2:464c7e62d97d 45 // x positions of the player
yfkwok 2:464c7e62d97d 46 int _p1x;
yfkwok 2:464c7e62d97d 47
yfkwok 2:464c7e62d97d 48 Coin _coin;
yfkwok 2:464c7e62d97d 49 Object _block;
yfkwok 2:464c7e62d97d 50
yfkwok 2:464c7e62d97d 51 Direction _d;
yfkwok 2:464c7e62d97d 52 float _mag;
yfkwok 2:464c7e62d97d 53 int _count;
yfkwok 2:464c7e62d97d 54 int _alt;
yfkwok 2:464c7e62d97d 55 int _type;
yfkwok 2:464c7e62d97d 56
yfkwok 2:464c7e62d97d 57 };
yfkwok 2:464c7e62d97d 58
yfkwok 2:464c7e62d97d 59 #endif