mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 09:58:09 +01:00
feat: player coordinate are at the center of a tile
This commit is contained in:
parent
15de3cc857
commit
76fba8fd8a
2 changed files with 5 additions and 5 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue