QUOTE: Enjoy small things, cherish moments.

player.h - freezo - A retro platform game

freezo

A retro platform game
git clone git@soophie.de:/srv/git/freezo
log | files | refs | readme

player.h (681B)


      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 #define PLAYER_MAX_HEALTH 6
     11 
     12 struct 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 
     32 player_t *player_create(pos_t pos);
     33 void player_update(player_t *player, game_t *game);
     34 void player_draw(player_t *player, game_t *game);
     35 void player_free(player_t *player);