/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* collision.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: qmennen +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/22 14:40:59 by qmennen #+# #+# */ /* Updated: 2025/04/22 14:42:09 by qmennen ### ########.fr */ /* */ /* ************************************************************************** */ #include "collision.h" int collision_horizontal(t_map *map, t_player *player, float xa) { t_tile tile; tile = get_tile(map, (int) ((player->pos.x + xa) / TILE_SIZE), (int) ((player->pos.y) / TILE_SIZE)); return (tile != TILE_WALL && tile != TILE_VOID); } int collision_vertical(t_map *map, t_player *player, float ya) { t_tile tile; tile = get_tile(map, (int) ((player->pos.x) / TILE_SIZE), (int) ((player->pos.y + ya) / TILE_SIZE)); return (tile != TILE_WALL && tile != TILE_VOID); }