From a17a641cd2fd63e801f82f8ff462be9b473dbdce Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 21 Apr 2021 14:22:11 +0000 Subject: fixed bullets --- asteroids.c | 6 +++--- 1 file 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); -- cgit v1.2.1