#ifndef _DEF_PLAYER #define _DEF_PLAYER #include #include "vec.h" #include "player_vars.h" typedef struct Player { Vec pos; Vec spd; /* velocity */ Vec hbox; /* the bottom left corner of the player's hitbox */ Vec vbox; /* the bottom left corner of the player's visual box */ Vec origin; /* the origin of the sprite (offset) */ unsigned int grace; /* coyot jump */ bool jump_held; /* used to control jump height */ bool dead; /* set to true the player will die */ Player_vars vars; } Player; #include "level.h" #include "camera.h" #include "input.h" void player_init(Player *player, const Level *level); void player_set_vars(Player *player, const Level *level); void player_move(Player *player, const Level *level); void player_step(Player *player, Input *input, const Level *level, uint step); void player_draw(Player *player, Camera *camera); void player_draw_debug(Player *player, uint step, const Level *level); #endif /* _DEF_PLAYER */