jtmm2/include/collide.h

20 lines
732 B
C

#ifndef _DEF_PLAYER_COLLIDE
#define _DEF_PLAYER_COLLIDE
#include <gint/defs/types.h>
#include <stdbool.h>
#include "conf.h"
#include "level.h"
/* return tile at the given position
* -1 is out of bound */
uint8_t collide_point(Vec point, const Level *level, uint layer);
_Bool collide_right(Player *player, Vec position, const Level *level, uint layer_id);
_Bool collide_left(Player *player, Vec position, const Level *level, uint layer_id);
_Bool collide_down(Player *player, Vec position, const Level *level, uint layer_id);
_Bool collide_up(Player *player, Vec position, const Level *level, uint layer_id);
_Bool collide_full(Player *player, Vec position, const Level *level, uint layer_id);
#endif /* _DEF_PLAYER_COLLIDE */