aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_basic_keys.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-02-14 18:47:19 +0100
committerRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-02-14 18:47:19 +0100
commit8e6080e73661cc8747b21b1153e4336796575cf7 (patch)
tree2eaec487a73f9df1a69627cff23c42746f1b296e /src/ft_basic_keys.c
parentAdded turn around keys (diff)
download42-cub3d-8e6080e73661cc8747b21b1153e4336796575cf7.tar.gz
42-cub3d-8e6080e73661cc8747b21b1153e4336796575cf7.tar.bz2
42-cub3d-8e6080e73661cc8747b21b1153e4336796575cf7.tar.xz
42-cub3d-8e6080e73661cc8747b21b1153e4336796575cf7.tar.zst
42-cub3d-8e6080e73661cc8747b21b1153e4336796575cf7.zip
Norme is bav
Diffstat (limited to 'src/ft_basic_keys.c')
-rw-r--r--src/ft_basic_keys.c55
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);
+}