Mortal Kombat Game ELEC2645
Dependencies: mbed N5110 ShiftReg Joystick
Enemy.h@6:a1a7dc264fed, 2021-04-21 (annotated)
- Committer:
- ozy
- Date:
- Wed Apr 21 22:56:55 2021 +0000
- Revision:
- 6:a1a7dc264fed
- Parent:
- 5:889ad974b64d
- Child:
- 7:737fb0c3dbef
Code before FighterClass change to GameEngine
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ozy | 1:3bdadf6f6dbd | 1 | #ifndef ENEMY_H |
ozy | 1:3bdadf6f6dbd | 2 | #define ENEMY_H |
ozy | 1:3bdadf6f6dbd | 3 | |
ozy | 1:3bdadf6f6dbd | 4 | #include "mbed.h" |
ozy | 1:3bdadf6f6dbd | 5 | #include "N5110.h" |
ozy | 1:3bdadf6f6dbd | 6 | |
ozy | 6:a1a7dc264fed | 7 | class Enemy |
ozy | 1:3bdadf6f6dbd | 8 | { |
ozy | 1:3bdadf6f6dbd | 9 | public: |
ozy | 6:a1a7dc264fed | 10 | Enemy(); // constructor |
ozy | 5:889ad974b64d | 11 | int get_x(); // get x co-ordinate |
ozy | 5:889ad974b64d | 12 | int get_y(); // get y co-ordinate |
ozy | 5:889ad974b64d | 13 | void set_x(int x); // set x co-ordinate |
ozy | 5:889ad974b64d | 14 | void set_y(int y); // set y co-ordinate |
ozy | 5:889ad974b64d | 15 | void add_x(int x); // add to the x co-ordinate |
ozy | 5:889ad974b64d | 16 | void add_y(int y); // add to the y co-ordinate |
ozy | 6:a1a7dc264fed | 17 | |
ozy | 6:a1a7dc264fed | 18 | void draw(N5110 &lcd); |
ozy | 5:889ad974b64d | 19 | void move_right(N5110 &lcd); // print move right animation |
ozy | 5:889ad974b64d | 20 | void move_left(N5110 &lcd); // print move left animation |
ozy | 5:889ad974b64d | 21 | void move_right2(N5110 &lcd); // 2nd move right animation to move legs |
ozy | 5:889ad974b64d | 22 | void move_left2(N5110 &lcd); // 2nd move left animation to move legs |
ozy | 6:a1a7dc264fed | 23 | void kick_right(N5110 &lcd); // enemy kick right |
ozy | 6:a1a7dc264fed | 24 | void kick_left(N5110 &lcd); // enemy kick left |
ozy | 6:a1a7dc264fed | 25 | void sword_left(N5110 &lcd); // enemy punch left |
ozy | 6:a1a7dc264fed | 26 | void sword_right(N5110 &lcd); // enemy punch right |
ozy | 6:a1a7dc264fed | 27 | |
ozy | 5:889ad974b64d | 28 | private: |
ozy | 5:889ad974b64d | 29 | int _x, _y; // co-ordinates of the enemy |
ozy | 1:3bdadf6f6dbd | 30 | }; |
ozy | 1:3bdadf6f6dbd | 31 | |
ozy | 6:a1a7dc264fed | 32 | #endif |