ELEC2645 (2018/19) / Mbed 2 deprecated EL17MCD

Dependencies:   mbed

Committer:
el17mcd
Date:
Wed Apr 24 13:44:12 2019 +0000
Revision:
16:a2c945279b79
Parent:
15:fa5282fcd134
Child:
17:cb39d9fa08dc
! Player now receives score at the end of the game. leaderboard added in the menus.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el17mcd 12:9e6d5d0a0c82 1 #ifndef TANK_H
el17mcd 12:9e6d5d0a0c82 2 #define TANK_H
el17mcd 7:a3ccabdebe2e 3
el17mcd 7:a3ccabdebe2e 4 #include "mbed.h"
el17mcd 7:a3ccabdebe2e 5 #include "N5110.h"
el17mcd 7:a3ccabdebe2e 6 #include "Gamepad.h"
el17mcd 7:a3ccabdebe2e 7
el17mcd 7:a3ccabdebe2e 8
el17mcd 12:9e6d5d0a0c82 9 class Tank
el17mcd 7:a3ccabdebe2e 10 {
el17mcd 16:a2c945279b79 11
el17mcd 7:a3ccabdebe2e 12 public:
el17mcd 11:4e2eb64031a0 13
el17mcd 12:9e6d5d0a0c82 14 Tank();
el17mcd 12:9e6d5d0a0c82 15 ~Tank();
el17mcd 16:a2c945279b79 16
el17mcd 10:d4fb12e9e7cd 17 //Accessors
el17mcd 7:a3ccabdebe2e 18 int get_position_x();
el17mcd 7:a3ccabdebe2e 19 int get_position_y();
el17mcd 7:a3ccabdebe2e 20 int get_hitbox(int i);
el17mcd 12:9e6d5d0a0c82 21 int get_health();
el17mcd 10:d4fb12e9e7cd 22 //Mutators
el17mcd 10:d4fb12e9e7cd 23 void set_position(int x, int y);
el17mcd 13:feadff02d3f7 24 void set_movement_limits(int left, int right);
el17mcd 7:a3ccabdebe2e 25 void set_health(int h);
el17mcd 15:fa5282fcd134 26 void set_speed(int s);
el17mcd 10:d4fb12e9e7cd 27 //Other Methods
el17mcd 10:d4fb12e9e7cd 28 void move_position(int d);
el17mcd 10:d4fb12e9e7cd 29 void lose_health();
el17mcd 10:d4fb12e9e7cd 30 void generate_hitbox();
el17mcd 7:a3ccabdebe2e 31
el17mcd 7:a3ccabdebe2e 32 private:
el17mcd 16:a2c945279b79 33
el17mcd 7:a3ccabdebe2e 34 int _position_x;
el17mcd 7:a3ccabdebe2e 35 int _position_y;
el17mcd 13:feadff02d3f7 36 int _left_lim;
el17mcd 13:feadff02d3f7 37 int _right_lim;
el17mcd 10:d4fb12e9e7cd 38 int _move_counter;
el17mcd 10:d4fb12e9e7cd 39 int _speed;
el17mcd 16:a2c945279b79 40 int _health;
el17mcd 7:a3ccabdebe2e 41 int _hitbox[40];
el17mcd 16:a2c945279b79 42
el17mcd 7:a3ccabdebe2e 43 };
el17mcd 7:a3ccabdebe2e 44
el17mcd 12:9e6d5d0a0c82 45 #endif // TANK_H