aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_collision.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_collision.c')
-rw-r--r--src/ft_collision.c8
1 files changed, 4 insertions, 4 deletions
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);