player.h (628B)
1 #pragma once 2 3 typedef struct Player player_t; 4 5 #include "util.h" 6 #include "enemy.h" 7 #include "game.h" 8 #include "entity.h" 9 10 struct Player { 11 pos_t pos; 12 int health; 13 bool on_ground; 14 float velocity; 15 float gravity; 16 int dir; 17 bool sneaking; 18 bool shooting; 19 int damage_timer; 20 float fall_height; 21 enemy_t *held_enemy; 22 bool moving; 23 timer_t *timer_walking; 24 timer_t *timer_sneaking; 25 entity_t *target_entity; 26 float shooting_distance; 27 }; 28 29 player_t *player_create(pos_t pos); 30 void player_update(player_t *player, game_t *game); 31 void player_draw(player_t *player, game_t *game); 32 void player_free(player_t *player);