ELEC2645 (2018/19) / Mbed 2 deprecated EL17MCD

Dependencies:   mbed

Committer:
el17mcd
Date:
Fri Apr 19 15:58:51 2019 +0000
Revision:
15:fa5282fcd134
Parent:
13:feadff02d3f7
Child:
16:a2c945279b79
! New Menus class that holds the menus for the game. Settings menu to toggle sound, change contrast and number of lives players start with.

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 7:a3ccabdebe2e 11 public:
el17mcd 11:4e2eb64031a0 12
el17mcd 12:9e6d5d0a0c82 13 Tank();
el17mcd 12:9e6d5d0a0c82 14 ~Tank();
el17mcd 10:d4fb12e9e7cd 15 //Accessors
el17mcd 7:a3ccabdebe2e 16 int get_position_x();
el17mcd 7:a3ccabdebe2e 17 int get_position_y();
el17mcd 7:a3ccabdebe2e 18 int get_hitbox(int i);
el17mcd 12:9e6d5d0a0c82 19 int get_health();
el17mcd 10:d4fb12e9e7cd 20 //Mutators
el17mcd 10:d4fb12e9e7cd 21 void set_position(int x, int y);
el17mcd 13:feadff02d3f7 22 void set_movement_limits(int left, int right);
el17mcd 7:a3ccabdebe2e 23 void set_health(int h);
el17mcd 15:fa5282fcd134 24 void set_speed(int s);
el17mcd 10:d4fb12e9e7cd 25 //Other Methods
el17mcd 10:d4fb12e9e7cd 26 void move_position(int d);
el17mcd 10:d4fb12e9e7cd 27 void lose_health();
el17mcd 10:d4fb12e9e7cd 28 void generate_hitbox();
el17mcd 7:a3ccabdebe2e 29
el17mcd 7:a3ccabdebe2e 30 private:
el17mcd 7:a3ccabdebe2e 31
el17mcd 13:feadff02d3f7 32 void _limit_movement();
el17mcd 13:feadff02d3f7 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 7:a3ccabdebe2e 40 int _hitbox[40];
el17mcd 7:a3ccabdebe2e 41 int _health;
el17mcd 7:a3ccabdebe2e 42 };
el17mcd 7:a3ccabdebe2e 43
el17mcd 12:9e6d5d0a0c82 44 #endif // TANK_H