added movement vector movement core

This commit is contained in:
Theo Champion 2025-07-09 17:08:01 +02:00
parent ba42e0d3e1
commit a58783350d
3 changed files with 23 additions and 16 deletions

View file

@ -6,7 +6,7 @@
/* By: tchampio <tchampio@student.42lehavre. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/06/06 17:42:23 by tchampio #+# #+# */
/* Updated: 2025/06/06 17:43:19 by tchampio ### ########.fr */
/* Updated: 2025/07/09 17:05:10 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,5 +16,6 @@
# define HEIGHT 800
# define WIDTH 800
# define RESSOURCE_DIR "ressources"
# define MOVEMENT_SPEED 10.0
#endif

View file

@ -32,6 +32,12 @@ typedef enum e_direction
WEST
} t_direction;
typedef struct s_vec2
{
double x;
double y;
} t_vec2;
typedef struct s_mapdata
{
char *filename;
@ -52,20 +58,13 @@ typedef struct s_mapdata
char error[1024];
} t_mapdata;
struct s_playermove {
int is_w_pressed;
int is_a_pressed;
int is_s_pressed;
int is_d_pressed;
};
typedef struct s_player
{
float x;
float y;
double yaw;
int health;
struct s_playermove playermove;
float x;
float y;
double yaw;
int health;
t_vec2 movement;
} t_player;
typedef struct s_cub3d_data