summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2024-01-07 12:24:38 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2024-01-07 12:24:38 +0100
commit33f39cd8ef08db0007c9690992bad99edbaa1795 (patch)
treee1e48263aaa124ca826b4c5984e3511e56bde70f /include
parent1f3e6604cf2df6ae11944f99f939b8b697ebd4d9 (diff)
zombie hit player
Diffstat (limited to 'include')
-rw-r--r--include/asset_defs.h3
-rw-r--r--include/audio.h1
-rw-r--r--include/players.h3
-rw-r--r--include/zombies.h8
4 files changed, 13 insertions, 2 deletions
diff --git a/include/asset_defs.h b/include/asset_defs.h
index 467837e..1f652d4 100644
--- a/include/asset_defs.h
+++ b/include/asset_defs.h
@@ -103,6 +103,9 @@ Mix_Chunk* wav_step_enraged;
#define NUM_SCREECHES 11
Mix_Chunk* wav_screech[NUM_SCREECHES];
+#define NUM_PLAYER_HURT 3
+Mix_Chunk* wav_player_hurt[NUM_PLAYER_HURT];
+
Mix_Music* music_inside1;
void load_assets();
diff --git a/include/audio.h b/include/audio.h
index b32148f..6414f5a 100644
--- a/include/audio.h
+++ b/include/audio.h
@@ -27,6 +27,7 @@ typedef enum t_audio_event_type {
EVENT_FOOTSTEP,
EVENT_ZOMBIESCREECH,
EVENT_ZOMBIEROAR,
+ EVENT_PLAYERHURT,
} audio_event_type;
typedef struct t_audio_event {
diff --git a/include/players.h b/include/players.h
index 7607788..b9b5710 100644
--- a/include/players.h
+++ b/include/players.h
@@ -44,6 +44,8 @@ typedef struct t_point_animation
typedef struct t_player {
u32 id;
bool active;
+ s32 health;
+ s32 max_health;
float sec_since_last_shot;
player_interact_state interact_state;
float sec_since_interact_state_change;
@@ -92,6 +94,7 @@ object check_if_player_collided_with_object(player p);
float get_player_size(platform_window* window);
void move_user(platform_window* window, u32 id, protocol_move_type move, float delta);
void update_players_server();
+void hurt_player(u32 id, u32 damage);
void spawn_player(u32 id, network_client client);
bool player_has_old_session(u32 id);
void rejoin_player(u32 id, network_client client);
diff --git a/include/zombies.h b/include/zombies.h
index b7c7889..ec80135 100644
--- a/include/zombies.h
+++ b/include/zombies.h
@@ -16,13 +16,17 @@ typedef enum t_zombie_type {
typedef struct t_zombie {
bool alive;
- float health;
- float max_health;
+ s32 health;
+ s32 max_health;
vec3f position;
vec3f size;
array path;
float speed;
+ float attack_range;
+ float attack_rate;
+ u32 attack_damage;
float sec_since_last_step;
+ float sec_since_last_attack;
array next_path;
float time_since_last_path;
pathfinding_request request;