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