From 88215b41b36ebae3e1d4afa6d12b5fb2e446f357 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 2 Apr 2020 16:22:57 +0200 Subject: Fixed coll now sprites, still revert if needed --- src/ft_collision.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ft_collision.c b/src/ft_collision.c index 859bfc3..385b2f7 100644 --- a/src/ft_collision.c +++ b/src/ft_collision.c @@ -23,11 +23,11 @@ static uint64_t if (key == 0) return (pl->pos_x + (pl->dir_x * FT_COLL_MULT)); else if (key == 1) - return (pl->pos_x + (pl->dir_y * (FT_COLL_MULT / 2))); + return (pl->pos_x + (-pl->dir_y * (FT_COLL_MULT / 2))); else if (key == 2) return (pl->pos_x - (pl->dir_x * FT_COLL_MULT)); else if (key == 3) - return (pl->pos_x - (pl->dir_y * (FT_COLL_MULT / 2))); + return (pl->pos_x - (-pl->dir_y * (FT_COLL_MULT / 2))); return ((uint64_t)pl->pos_x); } @@ -35,11 +35,11 @@ static uint64_t ft_find_y(int32_t key, const t_player *pl) { if (key == 0) - return (pl->pos_y + (pl->dir_y * FT_COLL_MULT)); + return (pl->pos_y + (-pl->dir_y * FT_COLL_MULT)); else if (key == 1) return (pl->pos_y - (pl->dir_x * (FT_COLL_MULT / 2))); else if (key == 2) - return (pl->pos_y - (pl->dir_y * FT_COLL_MULT)); + return (pl->pos_y - (-pl->dir_y * FT_COLL_MULT)); else if (key == 3) return (pl->pos_y + (pl->dir_x * (FT_COLL_MULT / 2))); return ((uint64_t)pl->pos_y); -- cgit v1.2.3