Projectile Library
Diff: Projectile.cpp
- Revision:
- 2:b079859c59ba
- Parent:
- 1:2aee0cb1ebf9
- Child:
- 3:70c599d9f191
--- a/Projectile.cpp Mon Apr 24 13:35:08 2017 +0000 +++ b/Projectile.cpp Sat Apr 29 13:17:35 2017 +0000 @@ -15,9 +15,10 @@ { _size = 1; //Make intial position of projectile = centre of player - - - + _velocity.x = 0; + _velocity.y = speed; + _x = playerx; + _y = playery; } void Projectile::draw(N5110 &lcd) @@ -33,8 +34,8 @@ void Projectile::set_velocity(Vector2D v) { - _velocity.x = v.x; - _velocity.y = v.y; + _velocity.x = 3; + _velocity.y = 3; } Vector2D Projectile::get_velocity() @@ -45,8 +46,8 @@ Vector2D Projectile::get_pos() { - Vector2D p = {_x,_y}; - return p; + Vector2D ppos = {_x,_y}; + return ppos; } void Projectile::set_pos(Vector2D p)