Mortal Kombat Game ELEC2645

Dependencies:   mbed N5110 ShiftReg Joystick

Committer:
ozy
Date:
Thu Apr 22 01:24:12 2021 +0000
Revision:
7:737fb0c3dbef
Parent:
6:a1a7dc264fed
Child:
8:e2e2eb4ea0ca
Code with Refresh problem

Who changed what in which revision?

UserRevisionLine numberNew 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 7:737fb0c3dbef 13 void init(N5110 &lcd);
ozy 5:889ad974b64d 14 void set_x(int x); // set x co-ordinate
ozy 5:889ad974b64d 15 void set_y(int y); // set y co-ordinate
ozy 5:889ad974b64d 16 void add_x(int x); // add to the x co-ordinate
ozy 5:889ad974b64d 17 void add_y(int y); // add to the y co-ordinate
ozy 6:a1a7dc264fed 18
ozy 6:a1a7dc264fed 19 void draw(N5110 &lcd);
ozy 5:889ad974b64d 20 void move_right(N5110 &lcd); // print move right animation
ozy 5:889ad974b64d 21 void move_left(N5110 &lcd); // print move left animation
ozy 5:889ad974b64d 22 void move_right2(N5110 &lcd); // 2nd move right animation to move legs
ozy 5:889ad974b64d 23 void move_left2(N5110 &lcd); // 2nd move left animation to move legs
ozy 6:a1a7dc264fed 24 void kick_right(N5110 &lcd); // enemy kick right
ozy 6:a1a7dc264fed 25 void kick_left(N5110 &lcd); // enemy kick left
ozy 6:a1a7dc264fed 26 void sword_left(N5110 &lcd); // enemy punch left
ozy 6:a1a7dc264fed 27 void sword_right(N5110 &lcd); // enemy punch right
ozy 6:a1a7dc264fed 28
ozy 5:889ad974b64d 29 private:
ozy 5:889ad974b64d 30 int _x, _y; // co-ordinates of the enemy
ozy 1:3bdadf6f6dbd 31 };
ozy 1:3bdadf6f6dbd 32
ozy 6:a1a7dc264fed 33 #endif