From e597be4f58e7252333192cb1e4211d74522b6102 Mon Sep 17 00:00:00 2001 From: Dominik Kaiser Date: Sat, 11 May 2024 16:27:45 +0200 Subject: Add wall rendering --- src/draw.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'src/draw.c') diff --git a/src/draw.c b/src/draw.c index de4ba48..b5e5455 100644 --- a/src/draw.c +++ b/src/draw.c @@ -6,13 +6,41 @@ /* By: dkaiser mlx, wall_texture); + mlx_resize_image(wall_image, 48, 48); + game->map.tile_size.x = 48; + game->map.tile_size.y = 48; + x = 0; + while (x < game->map.grid_size.x) + { + y = 0; + while (y < game->map.grid_size.y) + { + if (game->map.tiles[y * game->map.grid_size.x + x] == WALL) + mlx_image_to_window(game->mlx, wall_image, x * game->map.tile_size.x, y * game->map.tile_size.y); + y++; + } + x++; + } + return (0); +} + int draw(t_game *game) { game->player.img->instances[0].x = game->player.position.x; -- cgit v1.2.3