diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_key_events.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ft_key_events.c b/src/ft_key_events.c index 3fbfc6f..da24f7e 100644 --- a/src/ft_key_events.c +++ b/src/ft_key_events.c @@ -22,13 +22,13 @@ static int pl = clist->plist; if (pl->view_side == 1) - pl->pos_y -= 1; + pl->pos_y -= 0.4; else if (pl->view_side == 2) - pl->pos_x += 1; + pl->pos_x += 0.4; else if (pl->view_side == 3) - pl->pos_y += 1; + pl->pos_y += 0.4; else if (pl->view_side == 4) - pl->pos_x -= 1; + pl->pos_x -= 0.4; ft_drawmap(clist); return (0); } @@ -39,9 +39,9 @@ static int t_player *pl; pl = clist->plist; - pl->view_side -= 1; - if (pl->view_side == 0) - pl->view_side = 4; + pl->view_side -= 1.0; + if (pl->view_side < 1.0) + pl->view_side = 4.0; return (0); } @@ -51,14 +51,14 @@ static int t_player *pl; pl = clist->plist; - if (pl->view_side == 1) - pl->pos_y += 1; + if (pl->view_side >= 1) + pl->pos_y += 0.4; else if (pl->view_side == 2) - pl->pos_x -= 1; + pl->pos_x -= 0.4; else if (pl->view_side == 3) - pl->pos_y -= 1; + pl->pos_y -= 0.4; else if (pl->view_side == 4) - pl->pos_x += 1; + pl->pos_x += 0.4; ft_drawmap(clist); return (0); } @@ -69,9 +69,9 @@ static int t_player *pl; pl = clist->plist; - pl->view_side += 1; - if (pl->view_side == 5) - pl->view_side = 1; + pl->view_side += 1.0; + if (pl->view_side > 4.0) + pl->view_side = 1.0; return (0); } |