This repository has been archived on 2022-01-13. You can view files and clone it, but cannot push or open issues or pull requests.
jtmm2-old/include/player.h

29 lines
804 B
C
Raw Normal View History

#ifndef _DEF_PLAYER
#define _DEF_PLAYER
#include <stdbool.h>
#include "vec.h"
2020-12-21 12:18:55 +01:00
typedef struct Player {
Vec pos;
Vec spd; /* velocity */
2020-09-21 14:52:28 +02:00
Vec hbox; /* the bottom left corner of the player's hitbox */
Vec vbox; /* the bottom left corner of the player's visual box */
2020-12-27 23:53:34 +01:00
Vec origin; /* the origin of the sprite (offset) */
2020-12-23 23:22:02 +01:00
uint grace; /* coyot jump */
bool jump_held; /* used to control jump height */
2021-01-08 19:03:58 +01:00
bool dead; /* set to true the player will die */
} Player;
#include "level.h"
#include "camera.h"
#include "input.h"
void player_move(Player *player, const Level *level);
void player_step(Player *player, Input *input, const Level *level, uint step);
2020-09-11 18:07:53 +02:00
void player_draw(Player *player, Camera *camera);
void player_draw_debug(Player *player, uint step, const Level *level);
2020-09-11 18:07:53 +02:00
#endif /* _DEF_PLAYER */