summaryrefslogtreecommitdiff
path: root/include/so_long.h
diff options
context:
space:
mode:
authorDominik Kaiser2024-05-15 12:16:05 +0200
committerDominik Kaiser2024-05-15 12:16:05 +0200
commited5342399d02ba5d1032a2ef99afdc1c875ed4d8 (patch)
treee76d37b1d416f0405a7267a38d184eca32ad1bd8 /include/so_long.h
parent5a7e68ce0331077594dc2d85c81fc087d80734c7 (diff)
downloadso_long-ed5342399d02ba5d1032a2ef99afdc1c875ed4d8.tar.gz
so_long-ed5342399d02ba5d1032a2ef99afdc1c875ed4d8.zip
Change collision checking and add player.size
Collision checking will now be done using the move_and_slide function. Instead of tile_size, now player.size will be used for checking collisions.
Diffstat (limited to 'include/so_long.h')
-rw-r--r--include/so_long.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/so_long.h b/include/so_long.h
index cddfa9e..97ef5c7 100644
--- a/include/so_long.h
+++ b/include/so_long.h
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/08 14:14:02 by dkaiser #+# #+# */
-/* Updated: 2024/05/14 14:43:41 by dkaiser ### ########.fr */
+/* Updated: 2024/05/15 12:06:35 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -55,6 +55,7 @@ typedef struct s_player
t_vector position;
t_vector direction;
t_vector velocity;
+ t_ivector size;
mlx_image_t *img;
} t_player;
@@ -91,5 +92,6 @@ int check_collision(t_vector a_pos, t_ivector a_size,
t_vector b_pos, t_ivector b_size);
int check_wall_collision(t_vector a_pos, t_ivector a_size,
t_tilemap *map);
+void move_and_slide(t_player *player, t_tilemap *map);
#endif // SO_LONG_H