summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorarngo <[email protected]>2024-05-12 18:00:00 -0400
committerarngo <[email protected]>2024-05-12 18:00:00 -0400
commit9f0296d34c948b11619887185b01f2928fbb33a5 (patch)
tree15e83872ff5a7601ce6acab16657e864216c0381
parentc1cf626b9f1a70d7317c0b22719a65819126be4c (diff)
downloadtojam2024-9f0296d34c948b11619887185b01f2928fbb33a5.tar.gz
tojam2024-9f0296d34c948b11619887185b01f2928fbb33a5.zip
try again pt 3
-rw-r--r--src/bullet.c11
1 files 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;
}
}