feat: player coordinate are at the center of a tile

This commit is contained in:
Khaïs COLIN 2025-07-29 10:45:03 +02:00
parent 15de3cc857
commit 76fba8fd8a
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
2 changed files with 5 additions and 5 deletions

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/17 14:20:00 by kcolin #+# #+# */
/* Updated: 2025/07/17 15:55:44 by kcolin ### ########.fr */
/* Updated: 2025/07/29 11:58:34 by kcolin ### ########.fr */
/* */
/* ************************************************************************** */
@ -59,5 +59,5 @@ void draw_map(t_mapdata *map, t_player *player, t_img_data *data)
}
i++;
}
draw_2d_wall(0x00FF0000, data, MAP_SIZE * (player->x / SIZE), MAP_SIZE * (player->y / SIZE));
draw_2d_wall(0x00FF0000, data, MAP_SIZE * ((player->x - (float)SIZE / 2)) / SIZE, MAP_SIZE * ((player->y - (float)SIZE / 2) / SIZE));
}