aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_basic_keys.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-02 16:16:45 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-02 16:16:45 +0200
commitf922d1ed3235e3ce61c4e74420ae31354eb829d9 (patch)
treefaa1bea9c60dbbf79b91dded0ce9ef1afd552357 /src/ft_basic_keys.c
parentCorrect ray_pos (diff)
download42-cub3d-f922d1ed3235e3ce61c4e74420ae31354eb829d9.tar.gz
42-cub3d-f922d1ed3235e3ce61c4e74420ae31354eb829d9.tar.bz2
42-cub3d-f922d1ed3235e3ce61c4e74420ae31354eb829d9.tar.xz
42-cub3d-f922d1ed3235e3ce61c4e74420ae31354eb829d9.tar.zst
42-cub3d-f922d1ed3235e3ce61c4e74420ae31354eb829d9.zip
Revert this if needed, still sprites and collision to do
Diffstat (limited to 'src/ft_basic_keys.c')
-rw-r--r--src/ft_basic_keys.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ft_basic_keys.c b/src/ft_basic_keys.c
index 2d029ff..48a1305 100644
--- a/src/ft_basic_keys.c
+++ b/src/ft_basic_keys.c
@@ -20,34 +20,34 @@ int
const float move_speed = FT_MOVE_SPEED;
pl = &clist->plist;
- pl->pos_y += move_speed * pl->dir_y;
+ pl->pos_y += move_speed * -pl->dir_y;
pl->pos_x += move_speed * pl->dir_x;
clist->moves = 1;
return (0);
}
int
- ft_a_key(t_cub *clist)
+ ft_s_key(t_cub *clist)
{
t_player *pl;
- const float move_speed = FT_STRAFE_SPEED;
+ const float move_speed = FT_MOVE_SPEED;
pl = &clist->plist;
- pl->pos_y += move_speed * -pl->dir_x;
- pl->pos_x += move_speed * pl->dir_y;
+ pl->pos_y += move_speed * pl->dir_y;
+ pl->pos_x += move_speed * -pl->dir_x;
clist->moves = 1;
return (0);
}
int
- ft_s_key(t_cub *clist)
+ ft_a_key(t_cub *clist)
{
t_player *pl;
- const float move_speed = FT_MOVE_SPEED;
+ const float move_speed = FT_STRAFE_SPEED;
pl = &clist->plist;
- pl->pos_y += move_speed * -pl->dir_y;
- pl->pos_x += move_speed * -pl->dir_x;
+ pl->pos_y += move_speed * -pl->dir_x;
+ pl->pos_x += move_speed * -pl->dir_y;
clist->moves = 1;
return (0);
}
@@ -60,7 +60,7 @@ int
pl = &clist->plist;
pl->pos_y += move_speed * pl->dir_x;
- pl->pos_x += move_speed * -pl->dir_y;
+ pl->pos_x += move_speed * pl->dir_y;
clist->moves = 1;
return (0);
}