Mortal Kombat Game ELEC2645
Dependencies: mbed N5110 ShiftReg Joystick
Diff: GameEngine.h
- Revision:
- 18:22bda659c70a
- Parent:
- 17:928edcdd1058
- Child:
- 19:6c63e1dd7c85
--- a/GameEngine.h Tue Apr 27 23:21:21 2021 +0000 +++ b/GameEngine.h Thu Apr 29 22:40:08 2021 +0000 @@ -10,17 +10,23 @@ public: GameEngine(); // function to initialize game - void init(); + void init(N5110 &lcd, DigitalIn &buttonA, DigitalIn &buttonB, DigitalIn &buttonC); void start(N5110 &lcd, DigitalIn &buttonA, DigitalIn &buttonB, DigitalIn &buttonC, DigitalIn &buttonD, AnalogIn &joy_v, AnalogIn &joy_h); - void draw(N5110 &lcd); void enemy_AI(N5110 &lcd); + void game_over(N5110 &lcd); // to be updated: if enemy wins, print game over. if fighter wins, finish him + void set_fighter_health(int fighter_health); + void set_enemy_health(int enemy_health); + void reduce_f_health(int fighter_health); // function to reduce fighter health when hit + void reduce_e_health(int enemy_health); // function to reduce enemy health when hit + int get_fighter_health(); + int get_enemy_health(); + private: int check_collision(N5110 &lcd, DigitalIn &buttonA, DigitalIn &buttonB, DigitalIn &buttonC); - void deploy_next_god(); + int _fighter_health; + int _enemy_health; Fighter _fighter; Enemy _enemy; - int fighter_health; - int enemy_health; }; #endif \ No newline at end of file