2020-09-22 13:20:16 +02:00
|
|
|
#ifndef _DEF_PLAYER_COLLIDE
|
|
|
|
#define _DEF_PLAYER_COLLIDE
|
|
|
|
|
|
|
|
#include <gint/defs/types.h>
|
2020-09-28 12:53:04 +02:00
|
|
|
#include <stdbool.h>
|
2020-09-22 13:20:16 +02:00
|
|
|
|
|
|
|
#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);
|
2020-09-28 14:05:41 +02:00
|
|
|
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);
|
2020-09-22 13:20:16 +02:00
|
|
|
|
|
|
|
#endif /* _DEF_PLAYER_COLLIDE */
|