Mortal Kombat Game ELEC2645
Dependencies: mbed N5110 ShiftReg Joystick
Diff: Fighter.h
- Revision:
- 3:1d99b6ad4f9e
- Parent:
- 0:99b49fd71085
- Child:
- 6:a1a7dc264fed
diff -r 1703eb2a68f8 -r 1d99b6ad4f9e Fighter.h --- a/Fighter.h Sat Apr 17 12:35:18 2021 +0000 +++ b/Fighter.h Mon Apr 19 18:38:59 2021 +0000 @@ -9,18 +9,27 @@ { public: Fighter(); // constructor - void draw(N5110 &lcd, float _x, float _y); // x-coordinate and y-coordinates used to update place of sprite on screen - void move_right(N5110 &lcd, float _x, float _y); // print move right animation - void move_left(N5110 &lcd, float _x, float _y); // print move left animation - void move_right2(N5110 &lcd, float _x, float _y); // 2nd move right animation to move legs - void move_left2(N5110 &lcd, float _x, float _y); // 2nd move left animation to move legs - void kick_right(N5110 &lcd, float _x, float _y); // kick right - void kick_left(N5110 &lcd, float _x, float _y); // kick left - void punch_left(N5110 &lcd, float _x, float _y); // punch left - void punch_right(N5110 &lcd, float _x, float _y); // punch right - void guard(N5110 &lcd, float _x, float _y); // guard move - - + + int get_x(); // get x co-ordinate + int get_y(); // get y co-ordinate + void set_x(int x); // set x co-ordinate + void set_y(int y); // set y co-ordinate + void add_x(int x); // add to the x co-ordinate + void add_y(int y); // add to the y co-ordinate + + void draw(N5110 &lcd); // x-coordinate and y-coordinates used to update place of sprite on screen + void move_right(N5110 &lcd); // print move right animation + void move_left(N5110 &lcd); // print move left animation + void move_right2(N5110 &lcd); // 2nd move right animation to move legs + void move_left2(N5110 &lcd); // 2nd move left animation to move legs + void kick_right(N5110 &lcd); // kick right + void kick_left(N5110 &lcd); // kick left + void punch_left(N5110 &lcd); // punch left + void punch_right(N5110 &lcd); // punch right + void guard(N5110 &lcd); // guard move + +private: + int _x, _y; // co-ordinates of the fighter };