diff options
| author | arngo <[email protected]> | 2024-05-12 18:00:00 -0400 |
|---|---|---|
| committer | arngo <[email protected]> | 2024-05-12 18:00:00 -0400 |
| commit | 9f0296d34c948b11619887185b01f2928fbb33a5 (patch) | |
| tree | 15e83872ff5a7601ce6acab16657e864216c0381 /src/bullet.c | |
| parent | c1cf626b9f1a70d7317c0b22719a65819126be4c (diff) | |
| download | tojam2024-9f0296d34c948b11619887185b01f2928fbb33a5.tar.gz tojam2024-9f0296d34c948b11619887185b01f2928fbb33a5.zip | |
try again pt 3
Diffstat (limited to 'src/bullet.c')
| -rw-r--r-- | src/bullet.c | 11 |
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; } } |
