feat: added angle support

This commit is contained in:
Theo Champion 2025-07-24 14:37:18 +02:00 committed by Khaïs COLIN
parent 300f5c2e19
commit 6f25b4e530
4 changed files with 41 additions and 13 deletions

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/17 14:14:30 by kcolin #+# #+# */
/* Updated: 2025/07/22 12:50:14 by kcolin ### ########.fr */
/* Updated: 2025/07/24 14:31:07 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -22,18 +22,18 @@
#include <X11/X.h>
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
void init_player(t_mapdata *mapdata, t_player *player)
{
player->health = 100;
player->x = mapdata->startx;
player->y = mapdata->starty;
player->yaw = M_PI;
}
int game_loop(t_cub3d_data *data)
{
data->player.x += data->player.movement.x;
data->player.y += data->player.movement.y;
mlx_destroy_image(data->mlx, data->img_data->img);
data->img_data->img = mlx_new_image(data->mlx, WIDTH, HEIGHT);
draw_map(data->map, &data->player, data->img_data);