summaryrefslogtreecommitdiff
path: root/src/players.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-05-18 12:31:46 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-05-18 12:31:46 +0200
commitf646ddb88ec19307d42729b7babdb77966449327 (patch)
tree0f7031bf54ef2b3274380211e05bcfa66420ebe3 /src/players.c
parent003c13a4ae07c3ec15a31df0f7f65e3d1ffe9ae0 (diff)
ingame menu & network work
Diffstat (limited to 'src/players.c')
-rw-r--r--src/players.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/players.c b/src/players.c
index 59fca4c..9a3804a 100644
--- a/src/players.c
+++ b/src/players.c
@@ -49,6 +49,13 @@ void rejoin_player(u32 id, network_client client) {
}
}
+void clear_players()
+{
+ for (int i = 0; i < MAX_PLAYERS; i++) {
+ players[i].active = 0;
+ }
+}
+
void spawn_player(u32 id, network_client client) {
for (int i = 0; i < MAX_PLAYERS; i++) {
if (players[i].active) continue;
@@ -74,6 +81,7 @@ void spawn_player(u32 id, network_client client) {
players[i].sprite_idle.zoom = 1.0f;
players[i].health = 500;
players[i].max_health = 500;
+ players[i].kills = 0;
players[i].direction = DIRECTION_DOWN;
players[i].connection_state = CONNECTED;