diff options
| author | Dominik Kaiser | 2024-05-15 12:36:00 +0200 |
|---|---|---|
| committer | GitHub | 2024-05-15 12:36:00 +0200 |
| commit | 012afb95fd1cb5c7e625b4b023c98573c0e0499f (patch) | |
| tree | e76d37b1d416f0405a7267a38d184eca32ad1bd8 /src/init.c | |
| parent | 7b021c4426f21bf20fed61459ddedb5224e25bc4 (diff) | |
| parent | ed5342399d02ba5d1032a2ef99afdc1c875ed4d8 (diff) | |
| download | so_long-012afb95fd1cb5c7e625b4b023c98573c0e0499f.tar.gz so_long-012afb95fd1cb5c7e625b4b023c98573c0e0499f.zip | |
Merge collision into master
Collision
Diffstat (limited to 'src/init.c')
| -rw-r--r-- | src/init.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -6,7 +6,7 @@ /* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/09 14:50:09 by dkaiser #+# #+# */ -/* Updated: 2024/05/11 16:23:54 by dkaiser ### ########.fr */ +/* Updated: 2024/05/15 12:13:03 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ @@ -40,12 +40,14 @@ static void init_player(t_game *game) player = &game->player; texture = mlx_load_png("textures/player.png"); - player->position.x = game->map.player_start_tile.x * 48; - player->position.y = game->map.player_start_tile.y * 48; + player->position.x = game->map.player_start_tile.x * game->map.grid_size.x; + player->position.y = game->map.player_start_tile.y * game->map.grid_size.y; player->velocity.x = 0; player->velocity.y = 0; + player->size.x = 44; + player->size.y = 44; player->img = mlx_texture_to_image(game->mlx, texture); - mlx_resize_image(player->img, 48, 48); + mlx_resize_image(player->img, player->size.x, player->size.y); mlx_image_to_window(game->mlx, player->img, player->position.x, player->position.y); } |
