diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_collision.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ft_collision.c b/src/ft_collision.c index 00dab1f..859bfc3 100644 --- a/src/ft_collision.c +++ b/src/ft_collision.c @@ -21,13 +21,13 @@ static uint64_t ft_find_x(int32_t key, const t_player *pl) { if (key == 0) - return (pl->pos_x + (pl->dir_y * FT_COLL_MULT)); + return (pl->pos_x + (pl->dir_x * FT_COLL_MULT)); else if (key == 1) - return (pl->pos_x + (pl->dir_x * (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_y * FT_COLL_MULT)); + return (pl->pos_x - (pl->dir_x * FT_COLL_MULT)); else if (key == 3) - return (pl->pos_x - (pl->dir_x * (FT_COLL_MULT / 2))); + return (pl->pos_x - (pl->dir_y * (FT_COLL_MULT / 2))); return ((uint64_t)pl->pos_x); } @@ -35,13 +35,13 @@ static uint64_t ft_find_y(int32_t key, const t_player *pl) { if (key == 0) - return (pl->pos_y + (pl->dir_x * FT_COLL_MULT)); + return (pl->pos_y + (pl->dir_y * FT_COLL_MULT)); else if (key == 1) - return (pl->pos_y - (pl->dir_y * (FT_COLL_MULT / 2))); + return (pl->pos_y - (pl->dir_x * (FT_COLL_MULT / 2))); else if (key == 2) - return (pl->pos_y - (pl->dir_x * FT_COLL_MULT)); + return (pl->pos_y - (pl->dir_y * FT_COLL_MULT)); else if (key == 3) - return (pl->pos_y + (pl->dir_y * (FT_COLL_MULT / 2))); + return (pl->pos_y + (pl->dir_x * (FT_COLL_MULT / 2))); return ((uint64_t)pl->pos_y); } |