Mortal Kombat Game ELEC2645
Dependencies: mbed N5110 ShiftReg Joystick
Fighter.h
00001 #ifndef FIGHTER_H 00002 #define FIGHTER_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 00007 00008 class Fighter 00009 { 00010 public: 00011 Fighter(); // constructor 00012 00013 int get_x(); // get x co-ordinate 00014 int get_y(); // get y co-ordinate 00015 void init(); 00016 void set_x(int x); // set x co-ordinate 00017 void set_y(int y); // set y co-ordinate 00018 void add_x(int x); // add to the x co-ordinate 00019 void add_y(int y); // add to the y co-ordinate 00020 00021 void draw(N5110 &lcd); // x-coordinate and y-coordinates used to update place of sprite on screen 00022 void move_fighter(N5110 &lcd, DigitalIn &buttonA, DigitalIn &buttonB, DigitalIn &buttonC, DigitalIn &buttonD, AnalogIn &joy_v, AnalogIn &joy_h); 00023 void move_right(N5110 &lcd); // print move right animation 00024 void move_left(N5110 &lcd); // print move left animation 00025 int kick_right(N5110 &lcd); // kick right 00026 int kick_left(N5110 &lcd); // kick left 00027 int punch_left(N5110 &lcd); // punch left 00028 int punch_right(N5110 &lcd); // punch right 00029 void guard(N5110 &lcd); // guard move 00030 00031 private: 00032 int _x, _y; // co-ordinates of the fighter 00033 00034 }; 00035 00036 #endif
Generated on Fri Jul 29 2022 14:20:18 by 1.7.2