mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 01:48:08 +01:00
feat: added angle support
This commit is contained in:
parent
300f5c2e19
commit
6f25b4e530
4 changed files with 41 additions and 13 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue