Mortal Kombat Game ELEC2645

Dependencies:   mbed N5110 ShiftReg Joystick

Committer:
ozy
Date:
Sun Apr 25 00:16:59 2021 +0000
Revision:
12:b4477a312158
Parent:
8:e2e2eb4ea0ca
Child:
13:eaf070d5f599
Code before enemy move_around function

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 8:e2e2eb4ea0ca 13 void init();
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 8:e2e2eb4ea0ca 19 void draw(N5110 &lcd, int input);
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 12:b4477a312158 28 void twoway_punch(N5110 &lcd);
ozy 12:b4477a312158 29 void randomize_moves(N5110 &lcd, int input);
ozy 12:b4477a312158 30 void move_around(N5110 &lcd);
ozy 6:a1a7dc264fed 31
ozy 5:889ad974b64d 32 private:
ozy 5:889ad974b64d 33 int _x, _y; // co-ordinates of the enemy
ozy 1:3bdadf6f6dbd 34 };
ozy 1:3bdadf6f6dbd 35
ozy 6:a1a7dc264fed 36 #endif