From 55bc5cc3a5578acb1779cbc181d5b90baa5b3210 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Mon, 10 Feb 2020 18:37:19 +0100 Subject: eqwqyeuqwrqwreqrq --- src/ft_key_events.c | 56 ++++++++++------------------------------------------- 1 file changed, 10 insertions(+), 46 deletions(-) (limited to 'src/ft_key_events.c') diff --git a/src/ft_key_events.c b/src/ft_key_events.c index d400684..5ca3d36 100644 --- a/src/ft_key_events.c +++ b/src/ft_key_events.c @@ -21,26 +21,8 @@ static int t_player *pl; pl = clist->plist; - if (pl->view_side == 1) - { - if ((pl->pos_y -= 0.3) < 0.4) - pl->pos_y = 0.4; - } - else if (pl->view_side == 2) - { - if ((pl->pos_x += 0.3) > clist->map_w - 0.4) - pl->pos_x = clist->map_w - 0.4; - } - else if (pl->view_side == 3) - { - if ((pl->pos_y += 0.3) > clist->map_h - 0.4) - pl->pos_y = clist->map_h - 0.4; - } - else if (pl->view_side == 4) - { - if ((pl->pos_x -= 0.3) < 0.4) - pl->pos_x = 0.4; - } + if ((pl->pos_y -= 0.3) < 0.4) + pl->pos_y = 0.4; ft_drawmap(clist); return (0); } @@ -51,9 +33,9 @@ static int t_player *pl; pl = clist->plist; - pl->view_side -= 1.0; - if (pl->view_side < 1.0) - pl->view_side = 4.0; + if ((pl->pos_x -= 0.3) < 0.4) + pl->pos_x = 0.4; + ft_drawmap(clist); return (0); } @@ -63,26 +45,8 @@ static int t_player *pl; pl = clist->plist; - if (pl->view_side == 1) - { - if ((pl->pos_y += 0.3) > clist->map_h - 0.4) - pl->pos_y = clist->map_h - 0.4; - } - else if (pl->view_side == 2) - { - if ((pl->pos_x -= 0.3) < 0.4) - pl->pos_x = 0.4; - } - else if (pl->view_side == 3) - { - if ((pl->pos_y -= 0.3) < 0.4) - pl->pos_y = 0.4; - } - else if (pl->view_side == 4) - { - if ((pl->pos_x += 0.3) > clist->map_w - 0.4) - pl->pos_x = clist->map_w - 0.4; - } + if ((pl->pos_y += 0.3) > clist->map_h - 0.4) + pl->pos_y = clist->map_h - 0.4; ft_drawmap(clist); return (0); } @@ -93,9 +57,9 @@ static int t_player *pl; pl = clist->plist; - pl->view_side += 1.0; - if (pl->view_side > 4.0) - pl->view_side = 1.0; + if ((pl->pos_x += 0.3) > clist->map_w - 0.4) + pl->pos_x = clist->map_w - 0.4; + ft_drawmap(clist); return (0); } -- cgit v1.2.3