player rotates and moves, rays for raycasting on map

This commit is contained in:
Hugo LAMY
2022-04-18 18:27:16 +02:00
parent 00b3612c16
commit 01eb2255d2
21 changed files with 689 additions and 138 deletions

View File

@@ -1,6 +1,14 @@
#ifndef CUBE3D_STRUCT_H
# define CUBE3D_STRUCT_H
typedef struct s_vec
{
int start_x;
int start_y;
int end_x;
int end_y;
} t_vec;
typedef struct s_game
{
// window
@@ -8,7 +16,27 @@ typedef struct s_game
void *win_ptr;
int win_size_x;
int win_size_y;
// rays
t_vec screen_dist;
t_vec screen_size;
t_vec ray;
// tmp
int ray_highlight;
int ray_activ;
// map
int map_size_x;
int map_size_y;
char **map;
int cell;
// rot
int rot;
double cosi;
double cosj;
double sini;
double sinj;
// player
double plr_exact_x;
double plr_exact_y;
int plr_x;
int plr_y;
// key hook