summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2024-05-12 17:39:18 -0400
committerrealtradam <[email protected]>2024-05-12 17:39:18 -0400
commit6042fa9181ebde0fb90a6f4ba2b4221699e6661f (patch)
treee82fc969fa9897f34e4f01dfbf53881e74e9562f
parent8475767975a0f07507908ba53dba894b97b48795 (diff)
downloadtojam2024-6042fa9181ebde0fb90a6f4ba2b4221699e6661f.tar.gz
tojam2024-6042fa9181ebde0fb90a6f4ba2b4221699e6661f.zip
second player can shoot and better colours
-rw-r--r--src/bullet.c9
-rw-r--r--src/main.c6
2 files changed, 13 insertions, 2 deletions
diff --git a/src/bullet.c b/src/bullet.c
index 5cff129..12e4ca6 100644
--- a/src/bullet.c
+++ b/src/bullet.c
@@ -42,7 +42,14 @@ render_bullets(void)
{
continue;
}
- DrawCube(bullets[i].position, 0.25, 0.25, 0.25, RED);
+ else if(bullets[i].team == 1)
+ {
+ DrawCube(bullets[i].position, 0.25, 0.25, 0.25, DARKBLUE);
+ }
+ else if(bullets[i].team == 2)
+ {
+ DrawCube(bullets[i].position, 0.25, 0.25, 0.25, DARKPURPLE);
+ }
}
}
diff --git a/src/main.c b/src/main.c
index e60c9f2..ce5130c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -66,7 +66,7 @@ World world = {
.position = { 2, 0, 0 },
.direction = { -1, 0, 0 },
.speed = 1.0f/60.0f,
- .color = MAGENTA,
+ .color = VIOLET,
.camera_mode = 1,
}
}
@@ -148,6 +148,10 @@ int main(void)
{
spawn_bullet(1, world.players[0].position, world.players[0].direction);
}
+ if(pressed_p2.z)
+ {
+ spawn_bullet(2, world.players[1].position, world.players[1].direction);
+ }
bullet_collision_check();
movePlayers();