diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-11-07 20:24:19 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2023-11-07 20:24:19 +0100 |
| commit | 92489617eec44b913515404143baf5b094a16473 (patch) | |
| tree | e6d3d0424491052eb6f495ab3a64b725376ee76a /include | |
| parent | cf3cfecbcac3835c84dce3711884b7ce0a81b6b8 (diff) | |
points
Diffstat (limited to 'include')
| -rw-r--r-- | include/bullets.h | 2 | ||||
| -rw-r--r-- | include/players.h | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/bullets.h b/include/bullets.h index 26e4c5f..28ad175 100644 --- a/include/bullets.h +++ b/include/bullets.h @@ -8,6 +8,8 @@ #include "map.h" #include "guns.h" +#define POINTS_PER_HIT 10 + typedef struct t_bullet { u32 player_id; bool active; diff --git a/include/players.h b/include/players.h index a6b1745..a41b246 100644 --- a/include/players.h +++ b/include/players.h @@ -12,6 +12,7 @@ #include "../include/players.h" #define MAX_PLAYERS 10 +#define MAX_POINT_ANIMATIONS 10 typedef enum t_player_interact_state { INTERACT_IDLE, @@ -29,6 +30,16 @@ typedef enum t_player_direction { DIRECTION_BOTTOMRIGHT, } player_direction; +typedef struct t_point_animation +{ + bool active; + u32 points; + float diry; + vec2f position; + float sec_alive; + float opacity; +} point_animation; + typedef struct t_player { u32 id; bool active; @@ -52,12 +63,16 @@ typedef struct t_player { u64 ping; sprite sprite; network_state connection_state; + u32 points; struct { int grenades; int molotovs; } throwables; + point_animation point_animations[MAX_POINT_ANIMATIONS]; } player; + + #include "protocol.h" u32 player_id = -1; // Session id on current server. @@ -79,5 +94,7 @@ bool player_has_old_session(u32 id); void rejoin_player(u32 id, network_client client); char* get_player_name_by_player_index(int index); color get_color_tint_by_player_index(int index); +void add_points_to_player(player* p, u32 points); +void update_points_animation_server(); #endif
\ No newline at end of file |
