summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2024-05-12 17:48:59 -0400
committerrealtradam <[email protected]>2024-05-12 17:48:59 -0400
commit0366c7069fb441b42692d07d7d3e024fe330d666 (patch)
tree53512455debe747a16a20aa76d7b213fb06ebe0f /src
parent5fcd6b9dfe744768cdbb359277091ee03f610a6d (diff)
parenta88de0a1ab4bf6e254cfecc14407876fb0a32a4d (diff)
downloadtojam2024-0366c7069fb441b42692d07d7d3e024fe330d666.tar.gz
tojam2024-0366c7069fb441b42692d07d7d3e024fe330d666.zip
Merge branch 'master' of github.com:realtradam/tojam2024
Diffstat (limited to 'src')
-rw-r--r--src/bullet.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/bullet.c b/src/bullet.c
index 36b0e46..38cfe1e 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;
+ }
}
}