diff options
author | davidovski <david@sendula.com> | 2021-04-21 14:22:11 +0000 |
---|---|---|
committer | davidovski <david@sendula.com> | 2021-04-21 14:22:11 +0000 |
commit | a17a641cd2fd63e801f82f8ff462be9b473dbdce (patch) | |
tree | dec3f37627499194a6af43b12d018e0075c2f110 | |
parent | d4acc6aa37c042ded7f8b756facb7d6666c2d108 (diff) |
fixed bullets
-rw-r--r-- | asteroids.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/asteroids.c b/asteroids.c index e142816..5890b69 100644 --- a/asteroids.c +++ b/asteroids.c @@ -183,11 +183,11 @@ int draw() { for (int i=0; i < sizeof(bullets) / sizeof(Bullet); i++) { Bullet *b = &bullets[i]; if (b->size > 0) { - DrawLine( - b->pos.x, b->pos.y, - b->pos.x - (LAZER_LENGTH*b->vel.x), b->pos.y - (LAZER_LENGTH*b->vel.x), + DrawLineV( b->pos, + (Vector2){b->pos.x - LAZER_LENGTH*b->vel.x, b->pos.y - LAZER_LENGTH*b->vel.y}, fg ); + printf("(%f, %f)\n", b->vel.x, b->vel.y); b->pos.x += b->vel.x; b->pos.y += b->vel.y; clamp(&b->pos); |