aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_extra_keys.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-02-14 19:00:36 +0100
committerRudy Bousset <rbousset@z2r5p6.le-101.fr>2020-02-14 19:00:36 +0100
commit5ae557b6264dc84c228f5eed35d2f1009dcba488 (patch)
treec99f39dde578bd4a91bafed8ebec167cd7f731cc /src/ft_extra_keys.c
parentBug fix, changed rot speed (diff)
download42-cub3d-5ae557b6264dc84c228f5eed35d2f1009dcba488.tar.gz
42-cub3d-5ae557b6264dc84c228f5eed35d2f1009dcba488.tar.bz2
42-cub3d-5ae557b6264dc84c228f5eed35d2f1009dcba488.tar.xz
42-cub3d-5ae557b6264dc84c228f5eed35d2f1009dcba488.tar.zst
42-cub3d-5ae557b6264dc84c228f5eed35d2f1009dcba488.zip
Changed rotspeed again
Diffstat (limited to '')
-rw-r--r--src/ft_extra_keys.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/ft_extra_keys.c b/src/ft_extra_keys.c
index 2e9ccf7..ebcaf48 100644
--- a/src/ft_extra_keys.c
+++ b/src/ft_extra_keys.c
@@ -17,13 +17,12 @@
int
ft_left_key(t_cub *clist)
{
- t_player *pl;
- float sav_dir_x;
- float sav_plane_x;
- float rot_speed;
+ t_player *pl;
+ float sav_dir_x;
+ float sav_plane_x;
+ const float rot_speed = 0.08;
pl = clist->plist;
- rot_speed = 0.1;
sav_dir_x = pl->dir_x;
pl->dir_x = pl->dir_x * cos(rot_speed) - pl->dir_y * sin(rot_speed);
pl->dir_y = sav_dir_x * sin(rot_speed) + pl->dir_y * cos(rot_speed);
@@ -36,13 +35,12 @@ int
int
ft_right_key(t_cub *clist)
{
- t_player *pl;
- float sav_dir_x;
- float sav_plane_x;
- float rot_speed;
+ t_player *pl;
+ float sav_dir_x;
+ float sav_plane_x;
+ const float rot_speed = 0.08;
pl = clist->plist;
- rot_speed = 0.1;
sav_dir_x = pl->dir_x;
pl->dir_x = pl->dir_x * cos(-rot_speed) - pl->dir_y * sin(-rot_speed);
pl->dir_y = sav_dir_x * sin(-rot_speed) + pl->dir_y * cos(-rot_speed);