ELEC2645 (2018/19) / Mbed 2 deprecated EL17MCD

Dependencies:   mbed

Committer:
el17mcd
Date:
Wed Apr 10 14:27:37 2019 +0000
Revision:
9:fe912235dd71
Parent:
8:d4e419dad90f
Child:
11:4e2eb64031a0
! Working prototype for projectile ballistics using classes.

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 7:a3ccabdebe2e 13 void draw(N5110 &lcd);
el17mcd 8:d4e419dad90f 14 void generate_hitbox();
el17mcd 9:fe912235dd71 15 void update_flight();
el17mcd 9:fe912235dd71 16 bool check_boundaries();
el17mcd 7:a3ccabdebe2e 17 void set_position(int x, int y);
el17mcd 9:fe912235dd71 18 void set_launch_parameters(int t, int x, int y, float ang, float vel, float grav, float wind);
el17mcd 7:a3ccabdebe2e 19 int get_position_x();
el17mcd 7:a3ccabdebe2e 20 int get_position_y();
el17mcd 7:a3ccabdebe2e 21 int get_hitbox(int i);
el17mcd 7:a3ccabdebe2e 22
el17mcd 7:a3ccabdebe2e 23 private:
el17mcd 7:a3ccabdebe2e 24
el17mcd 7:a3ccabdebe2e 25 int _position_x;
el17mcd 7:a3ccabdebe2e 26 int _position_y;
el17mcd 7:a3ccabdebe2e 27 int _hitbox[5];
el17mcd 8:d4e419dad90f 28 int _time;
el17mcd 8:d4e419dad90f 29 int _init_x;
el17mcd 8:d4e419dad90f 30 int _init_y;
el17mcd 8:d4e419dad90f 31 float _lnch_ang;
el17mcd 9:fe912235dd71 32 float _init_vel; //1.3
el17mcd 9:fe912235dd71 33 float _grav_acc; //0.02
el17mcd 8:d4e419dad90f 34 float _wind_acc;
el17mcd 7:a3ccabdebe2e 35
el17mcd 7:a3ccabdebe2e 36 };
el17mcd 7:a3ccabdebe2e 37
el17mcd 7:a3ccabdebe2e 38 #endif // PROJECTILE_H