diff options
| author | realtradam <[email protected]> | 2024-05-12 17:48:59 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-05-12 17:48:59 -0400 |
| commit | 0366c7069fb441b42692d07d7d3e024fe330d666 (patch) | |
| tree | 53512455debe747a16a20aa76d7b213fb06ebe0f /src | |
| parent | 5fcd6b9dfe744768cdbb359277091ee03f610a6d (diff) | |
| parent | a88de0a1ab4bf6e254cfecc14407876fb0a32a4d (diff) | |
| download | tojam2024-0366c7069fb441b42692d07d7d3e024fe330d666.tar.gz tojam2024-0366c7069fb441b42692d07d7d3e024fe330d666.zip | |
Merge branch 'master' of github.com:realtradam/tojam2024
Diffstat (limited to 'src')
| -rw-r--r-- | src/bullet.c | 10 |
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; + } } } |
