Projectile Library
Diff: Projectile.cpp
- Revision:
- 6:70b35ebfa8c8
- Parent:
- 5:023fe92d6384
- Child:
- 7:50b6d2c95156
--- a/Projectile.cpp Tue May 02 15:46:40 2017 +0000 +++ b/Projectile.cpp Tue May 02 16:24:52 2017 +0000 @@ -14,7 +14,7 @@ void Projectile::init(int playerx, int playery) { - printf("playerxy proj = %d %d \n", playerx, playery); + //printf("playerxy proj = %d %d \n", playerx, playery); _playerx = playerx; _playery = playery; //Make intial position of projectile = centre of player @@ -26,10 +26,10 @@ void Projectile::draw(N5110 &lcd) { _velocity.x = 0; - _velocity.y = -3; + _velocity.y = -5; - printf("playerxy projdraw = %d %d \n", _playerx, _playery); + //printf("playerxy projdraw = %d %d \n", _playerx, _playery); if(_x <= -1){ @@ -53,7 +53,7 @@ m = m+1; } lcd.drawRect(_x,_y,1,1,FILL_BLACK); - printf("projdrawn %d %d \n", _x, _y); + //printf("projdrawn %d %d \n", _x, _y); //printf("playerpos in proj = %d %d \n", playerx, playery); } @@ -81,4 +81,10 @@ Vector2D projpos = {_x,_y}; //printf("projpos = %f %f \n", projpos.x, projpos.y); return projpos; +} + +void Projectile::set_pos(Vector2D p) +{ + _x = p.x; + _y = p.y; } \ No newline at end of file