summaryrefslogtreecommitdiff
path: root/include/so_long.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/so_long.h')
-rw-r--r--include/so_long.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/so_long.h b/include/so_long.h
index e9097d1..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/11 16:10:26 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;
@@ -80,8 +81,17 @@ int load_map_from_file(t_tilemap *tilemap, char *filename);
int init(t_game *game);
void loop(void *params);
+void player_process(t_game *game);
int draw(t_game *game);
int draw_map(t_game *game);
void on_key_input(mlx_key_data_t event, void *params);
+t_vector grid_to_screen_pos(t_ivector grid_pos, t_ivector tile_size);
+t_ivector screen_to_grid_pos(t_vector screen_pos, t_ivector tile_size);
+enum e_tile get_tile(t_tilemap *map, int x, int y);
+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