summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@sendula.com>2021-04-21 14:22:11 +0000
committerdavidovski <david@sendula.com>2021-04-21 14:22:11 +0000
commita17a641cd2fd63e801f82f8ff462be9b473dbdce (patch)
treedec3f37627499194a6af43b12d018e0075c2f110
parentd4acc6aa37c042ded7f8b756facb7d6666c2d108 (diff)
fixed bullets
-rw-r--r--asteroids.c6
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);