From 9f0296d34c948b11619887185b01f2928fbb33a5 Mon Sep 17 00:00:00 2001 From: arngo <27396817+arngo@users.noreply.github.com> Date: Sun, 12 May 2024 18:00:00 -0400 Subject: try again pt 3 --- src/bullet.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/bullet.c b/src/bullet.c index d891d8b..6fca87e 100644 --- a/src/bullet.c +++ b/src/bullet.c @@ -76,15 +76,18 @@ bullet_collision_check(void) if (bullets[i].team == 1) { enemypos = world.players[1].position; + if (Vector3Distance(bullets[i].position, enemypos) < 1) + { + world.players[0].points++; + bullets[i].team = 0; + } } else if (bullets[i].team == 2) { enemypos = world.players[0].position; - } - if (bullets[i].team != 0) { - if (Vector3Distance(bullets[i].position, enemypos)) + if (Vector3Distance(bullets[i].position, enemypos) < 1) { - world.players[bullets[i].team-1].points++; + world.players[1].points++; bullets[i].team = 0; } } -- cgit v1.2.3