From a88de0a1ab4bf6e254cfecc14407876fb0a32a4d Mon Sep 17 00:00:00 2001 From: arngo <27396817+arngo@users.noreply.github.com> Date: Sun, 12 May 2024 17:49:47 -0400 Subject: bullet point --- src/bullet.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bullet.c b/src/bullet.c index 785ce2f..271d14a 100644 --- a/src/bullet.c +++ b/src/bullet.c @@ -1,4 +1,6 @@ #include "bullet.h" +#include "world.h" +#include "raymath.h" typedef struct @@ -53,7 +55,7 @@ render_bullets(void) } } - void +void bullet_collision_check(void) { for(int i = 0; i < 100; ++i) @@ -70,6 +72,12 @@ bullet_collision_check(void) bullets[i].position.x += bullets[i].direction.x * 0.25; bullets[i].position.y += bullets[i].direction.y * 0.25; bullets[i].position.z += bullets[i].direction.z * 0.25; + Vector3 enemypos = world.players[bullets[i].team-1].position; + if (Vector3Distance(world.players[0].position, enemypos)) + { + world.players[bullets[i].team-1].points++; + bullets[i].team = 0; + } } } -- cgit v1.2.3