Skip to content

Commit 347732e

Browse files
committed
added jump size
1 parent c8d7d25 commit 347732e

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ maptest: all
9696
./$(NAME) maps/map_should_error/asciiart_dot_eu2.cub
9797
./$(NAME) maps/map_should_error/bad_color.cub
9898
./$(NAME) maps/map_should_error/codepen_io_MittenedWatchmaker.cub
99-
-./$(NAME) maps/map_should_error/extension_missing
99+
./$(NAME) maps/map_should_error/extension_missing
100100
./$(NAME) maps/map_should_error/map04small_space_in_col.cub
101101
./$(NAME) maps/map_should_error/map08missing_start.cub
102102
./$(NAME) maps/map_should_error/map09.cub
@@ -108,7 +108,7 @@ maptest: all
108108
./$(NAME) maps/map_should_error/open_two_n.cub
109109
./$(NAME) maps/map_should_error/single_n.cub
110110
./$(NAME) maps/map_should_error/small_open.cub
111-
- ./$(NAME) maps/map_should_error/wall_hole.cubb
111+
./$(NAME) maps/map_should_error/wall_hole.cubb
112112
./$(NAME) maps/map_should_ok/asciiart_dot_eu.cub
113113
./$(NAME) maps/simple_fail/S.cub
114114
./$(NAME) maps/simple_fail/nothing.cub

include/cub3d.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: mgraf <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2023/09/19 15:48:35 by mgraf #+# #+# */
9-
/* Updated: 2023/10/19 15:42:27 by mgraf ### ########.fr */
9+
/* Updated: 2023/10/19 16:28:46 by mgraf ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -32,7 +32,8 @@
3232
# define DEFAULT_WEST_TEXTURE "./textures/default_w_wall"
3333
# define DEFAULT_EAST_TEXTURE "./textures/default_e_wall"
3434
# define SPRITE_SIZE 64
35-
# define WALL_OFFSET 5
35+
# define WALL_OFFSET 8
36+
# define JUMP_SIZE 15.0
3637
# define WINDOW_WIDTH 1000
3738
# define WINDOW_HEIGHT 1000
3839
# define TINY_MAPX 100

srcs/draw/game.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: mgraf <[email protected]> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2023/10/04 17:06:52 by fheld #+# #+# */
9-
/* Updated: 2023/10/14 18:48:21 by mgraf ### ########.fr */
9+
/* Updated: 2023/10/19 16:21:23 by mgraf ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

srcs/move/move_player.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/* ::: :::::::: */
44
/* move_player.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: fheld <fheld@student.42.fr> +#+ +:+ +#+ */
6+
/* By: mgraf <mgraf@student.42berlin.de> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2023/10/01 22:57:28 by fheld #+# #+# */
9-
/* Updated: 2023/10/18 22:37:43 by fheld ### ########.fr */
9+
/* Updated: 2023/10/19 16:17:30 by mgraf ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -50,9 +50,9 @@ void move_forward(t_data *data)
5050
t_int_p2 end_pos;
5151
t_p2 end_pos_d;
5252

53-
end_pos_d.x = data->start.double_pos.x - (5.0 * \
53+
end_pos_d.x = data->start.double_pos.x - (JUMP_SIZE * \
5454
sin(data->start.dir / 180.0 * M_PI));
55-
end_pos_d.y = data->start.double_pos.y - (5.0 * \
55+
end_pos_d.y = data->start.double_pos.y - (JUMP_SIZE * \
5656
cos(data->start.dir / 180.0 * M_PI));
5757
end_pos.x = (int)end_pos_d.x;
5858
end_pos.y = (int)end_pos_d.y;
@@ -69,9 +69,9 @@ void move_backward(t_data *data)
6969
t_int_p2 end_pos;
7070
t_p2 end_pos_d;
7171

72-
end_pos_d.x = data->start.double_pos.x + (5.0 * \
72+
end_pos_d.x = data->start.double_pos.x + (JUMP_SIZE * \
7373
sin(data->start.dir / 180.0 * M_PI));
74-
end_pos_d.y = data->start.double_pos.y + (5.0 * \
74+
end_pos_d.y = data->start.double_pos.y + (JUMP_SIZE * \
7575
cos(data->start.dir / 180.0 * M_PI));
7676
end_pos.x = (int)end_pos_d.x;
7777
end_pos.y = (int)end_pos_d.y;

0 commit comments

Comments
 (0)