summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/game.h2
-rw-r--r--include/players.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/include/game.h b/include/game.h
index 9f0d173..faf2bc9 100644
--- a/include/game.h
+++ b/include/game.h
@@ -27,7 +27,7 @@ typedef struct t_game {
network_client *client;
} game;
-game global_state;
+game global_state = {GAMESTATE_IDLE,DISCONNECTED,0,0};
void init_game();
diff --git a/include/players.h b/include/players.h
index 258a1fb..e51e4e2 100644
--- a/include/players.h
+++ b/include/players.h
@@ -21,6 +21,7 @@ typedef struct t_player {
int total_ammo;
int ammo_in_mag;
gun_type guntype;
+ network_client client; // For the host: is_connected = false and socket = 0
} player;
#include "protocol.h"
@@ -32,6 +33,7 @@ camera _next_camera_pos;
int max_players = 10;
player players[10] = {0};
+int get_player_count();
player* get_player_by_id(u32 id);
void draw_players_at_tile(platform_window* window, int x, int y);
void draw_bullets(platform_window* window);
@@ -39,5 +41,6 @@ object check_if_player_collided_with_object(platform_window* window, player p);
float get_player_size(platform_window* window);
void move_user(platform_window* window, u32 id, protocol_move_type move);
void update_players_server();
+void spawn_player(int id, network_client client);
#endif \ No newline at end of file