ELEC2645 (2018/19) / Mbed 2 deprecated EL17MCD

Dependencies:   mbed

Revision:
11:4e2eb64031a0
Parent:
9:fe912235dd71
Child:
12:9e6d5d0a0c82
--- a/Projectile/Projectile.cpp	Fri Apr 12 12:01:47 2019 +0000
+++ b/Projectile/Projectile.cpp	Sat Apr 13 16:31:43 2019 +0000
@@ -40,7 +40,7 @@
 {
     _position_x = _init_x + _init_vel * _time * cos(_lnch_ang * DEG2PI) - 0.5 * _wind_acc * _time * _time;
     _position_y = _init_y + _init_vel * _time * sin(_lnch_ang * DEG2PI) - 0.5 * _grav_acc * _time * _time;
-    _time++;
+    _time += 0.4;
 }
 
 bool Projectile::check_boundaries()
@@ -55,9 +55,9 @@
     _position_y = y;
 }
 
-void Projectile::set_launch_parameters(int t, int x, int y, float ang, float vel, float grav, float wind)
+void Projectile::set_launch_parameters(int x, int y, float ang, float vel, float grav, float wind)
 {
-    _time = t;
+    _time = 0;
     _init_x = x;
     _init_y = y;
     _lnch_ang = ang;