ELEC2645 (2018/19) / Mbed 2 deprecated EL17MCD

Dependencies:   mbed

Committer:
el17mcd
Date:
Sun Apr 14 15:58:12 2019 +0000
Revision:
12:9e6d5d0a0c82
Parent:
11:4e2eb64031a0
Child:
16:a2c945279b79
! TankL class changed into generic Tank class. Separate graphics class to house and govern the use of sprites. Game now can produce two tanks on the screen facing opposite directions. They can take turns to fire projectiles based off joystick angle.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el17mcd 7:a3ccabdebe2e 1 #ifndef PROJECTILE_H
el17mcd 7:a3ccabdebe2e 2 #define PROJECTILE_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 7:a3ccabdebe2e 9 class Projectile
el17mcd 7:a3ccabdebe2e 10 {
el17mcd 7:a3ccabdebe2e 11 public:
el17mcd 7:a3ccabdebe2e 12
el17mcd 8:d4e419dad90f 13 void generate_hitbox();
el17mcd 9:fe912235dd71 14 void update_flight();
el17mcd 9:fe912235dd71 15 bool check_boundaries();
el17mcd 7:a3ccabdebe2e 16 void set_position(int x, int y);
el17mcd 11:4e2eb64031a0 17 void set_launch_parameters(int x, int y, float ang, float vel, float grav, float wind);
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 7:a3ccabdebe2e 21
el17mcd 7:a3ccabdebe2e 22 private:
el17mcd 7:a3ccabdebe2e 23
el17mcd 7:a3ccabdebe2e 24 int _position_x;
el17mcd 7:a3ccabdebe2e 25 int _position_y;
el17mcd 7:a3ccabdebe2e 26 int _hitbox[5];
el17mcd 8:d4e419dad90f 27 int _init_x;
el17mcd 8:d4e419dad90f 28 int _init_y;
el17mcd 11:4e2eb64031a0 29 float _time;
el17mcd 8:d4e419dad90f 30 float _lnch_ang;
el17mcd 9:fe912235dd71 31 float _init_vel; //1.3
el17mcd 9:fe912235dd71 32 float _grav_acc; //0.02
el17mcd 8:d4e419dad90f 33 float _wind_acc;
el17mcd 7:a3ccabdebe2e 34
el17mcd 7:a3ccabdebe2e 35 };
el17mcd 7:a3ccabdebe2e 36
el17mcd 7:a3ccabdebe2e 37 #endif // PROJECTILE_H