diff options
Diffstat (limited to 'src/ft_basic_keys.c')
-rw-r--r-- | src/ft_basic_keys.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/ft_basic_keys.c b/src/ft_basic_keys.c new file mode 100644 index 0000000..48fc009 --- /dev/null +++ b/src/ft_basic_keys.c @@ -0,0 +1,55 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_basic_keys.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:43:55 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:43:56 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <cub3d.h> +#include <stdint.h> + +int + ft_w_key(t_cub *clist) +{ + t_player *pl; + + pl = clist->plist; + pl->pos_y += 0.2 * (-1); + pl->pos_x += 0; + return (0); +} + +int + ft_a_key(t_cub *clist) +{ + t_player *pl; + + pl = clist->plist; + pl->pos_x -= 0.2; + return (0); +} + +int + ft_s_key(t_cub *clist) +{ + t_player *pl; + + pl = clist->plist; + pl->pos_y += 0.2; + return (0); +} + +int + ft_d_key(t_cub *clist) +{ + t_player *pl; + + pl = clist->plist; + pl->pos_x += 0.2; + return (0); +} |