「🏗️」 wip(Raycasting): Seems working but not
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/04 14:04:10 by adjoly #+# #+# */
|
||||
/* Updated: 2024/10/13 21:28:23 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/10/23 15:00:05 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -42,7 +42,7 @@ void setup_dda(t_dda (*dda)[800], t_player *player);
|
||||
* @param map The map as a char **
|
||||
* @param map_coord The coordinate of the player on the map_grid
|
||||
*/
|
||||
void while_dda(t_dda (*dda)[800], char **map, t_coord map_coord);
|
||||
void while_dda(t_dda (*dda)[800], char **map, t_player *player);
|
||||
|
||||
/// NEED TO COMBINE THOSE IF NOT USEFULL TO SEPARATE
|
||||
/**
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/11 16:38:40 by adjoly #+# #+# */
|
||||
/* Updated: 2024/10/08 21:42:52 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/10/24 11:38:56 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -41,9 +41,8 @@ int key_hook(int key, void *param);
|
||||
*
|
||||
* @param cub The address of a t_cub struct filled with mlx data and other
|
||||
* thing
|
||||
*
|
||||
*/
|
||||
void get_player_image(t_cub *cub, uint8_t key_pressed);
|
||||
void get_player_image(t_cub *cub);
|
||||
|
||||
/**
|
||||
* @brief This function is here to change the direction of the player
|
||||
@ -54,7 +53,6 @@ void get_player_image(t_cub *cub, uint8_t key_pressed);
|
||||
* @param speed The speed a which the player rotate
|
||||
* @param clockwise The direction which the player rotate
|
||||
* @param player A pointer to a t_player struct
|
||||
*
|
||||
*/
|
||||
void change_direction(double speed, bool clockwise, t_player *player);
|
||||
|
||||
@ -65,7 +63,6 @@ void change_direction(double speed, bool clockwise, t_player *player);
|
||||
* @param coord The coordinate of the printed square
|
||||
* @param size The size of the printed square
|
||||
* @param color The color of the printed square
|
||||
*
|
||||
*/
|
||||
void draw_square(t_cub *cub, t_coord coord, uint16_t size, int color);
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/04 14:06:39 by adjoly #+# #+# */
|
||||
/* Updated: 2024/10/04 16:38:10 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/10/23 11:18:38 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -23,10 +23,10 @@
|
||||
# define WHITE 0xFFFFFFFF
|
||||
# define WINDOW_Y 900
|
||||
# define WINDOW_X 1600
|
||||
# define PLAYER_ROT_SPEED (2 * M_PI) / 8
|
||||
# define PLAYER_ROT_SPEED (2 * M_PI) / 128
|
||||
# define PLAYER_SPEED 3
|
||||
# define MAP_CHUNK_SIZE 64
|
||||
# define RAY_SIZE 2
|
||||
# define FOV 60 * (M_PI / 180)
|
||||
# define FOV ( 60 * (M_PI / 180) )
|
||||
|
||||
#endif
|
||||
|
@ -6,15 +6,15 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/04 14:28:24 by adjoly #+# #+# */
|
||||
/* Updated: 2024/10/08 13:43:59 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/10/23 14:33:33 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef STRUCT_H
|
||||
# define STRUCT_H
|
||||
|
||||
# include "parsing.h"
|
||||
# include <stdbool.h>
|
||||
# include "parsing.h"
|
||||
|
||||
/**
|
||||
* @brief Enum for the wall side that has been hit
|
||||
@ -39,8 +39,9 @@ typedef struct s_step
|
||||
|
||||
typedef struct s_player
|
||||
{
|
||||
t_coord coords;
|
||||
double direction;
|
||||
t_coord coords;
|
||||
t_coord map_coords;
|
||||
double direction;
|
||||
} t_player;
|
||||
|
||||
typedef struct s_cub
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: madumerg <madumerg@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/12 12:49:16 by madumerg #+# #+# */
|
||||
/* Updated: 2024/09/12 16:58:29 by madumerg ### ########.fr */
|
||||
/* Updated: 2024/10/19 15:37:50 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
Reference in New Issue
Block a user