diff --git a/assets/maps/map2.cub b/assets/maps/map2.cub index 9fab109..736a428 100755 --- a/assets/maps/map2.cub +++ b/assets/maps/map2.cub @@ -1,9 +1,9 @@ -NO assets/textures/backRoom3.png -SO assets/textures/forest.png -WE assets/textures/backRoom3.png -EA assets/textures/backRoom3.png +NO assets/textures/wallTlou.png +SO assets/textures/wallTlou.png +WE assets/textures/wallTlou.png +EA assets/textures/wallTlou.png F 30,55,55 C 255,255,255 diff --git a/assets/textures/forest.png b/assets/textures/forest.png deleted file mode 100644 index 1a140fc..0000000 Binary files a/assets/textures/forest.png and /dev/null differ diff --git a/assets/textures/backRoom3.png b/assets/textures/wallRoom.png similarity index 100% rename from assets/textures/backRoom3.png rename to assets/textures/wallRoom.png diff --git a/assets/textures/wallTlou.png b/assets/textures/wallTlou.png new file mode 100644 index 0000000..d360b7b Binary files /dev/null and b/assets/textures/wallTlou.png differ diff --git a/src/execution/execution.c b/src/execution/execution.c index ad2a71e..b05ab71 100755 --- a/src/execution/execution.c +++ b/src/execution/execution.c @@ -6,7 +6,7 @@ /* By: aortigos dt->sq_map[mlx->dt->p_y][mlx->dt->p_x]; - if (c == 'N') - mlx->ply->angle = 3 * M_PI / 2; - if (c == 'S') - mlx->ply->angle = M_PI / 2; - if (c == 'E') - mlx->ply->angle = 0; - if (c == 'W') - mlx->ply->angle = M_PI; - mlx->ply->plyr_x = (mlx->dt->p_x * WALL_SIZE) + WALL_SIZE / 2; - mlx->ply->plyr_y = (mlx->dt->p_y * WALL_SIZE) + WALL_SIZE / 2; - mlx->ply->fov_rd = (FOV * M_PI / 180); + c = mlx->dt->sq_map[mlx->dt->p_y][mlx->dt->p_x]; + if (c == 'N') // Norte - mira hacia arriba (Y negativo) + mlx->ply->angle = M_PI / 2; // 90° - no 270° + if (c == 'S') // Sur - mira hacia abajo (Y positivo) + mlx->ply->angle = 3 * M_PI / 2; // 270° - no 90° + if (c == 'E') // Este - mira hacia derecha (X positivo) + mlx->ply->angle = 0; + if (c == 'W') // Oeste - mira hacia izquierda (X negativo) + mlx->ply->angle = M_PI; // 180° + mlx->ply->plyr_x = (mlx->dt->p_x * WALL_SIZE) + WALL_SIZE / 2; + mlx->ply->plyr_y = (mlx->dt->p_y * WALL_SIZE) + WALL_SIZE / 2; + mlx->ply->fov_rd = (FOV * M_PI / 180); } int execution(t_data *dt) diff --git a/src/execution/movement.c b/src/execution/movement.c index 00749b6..3684228 100755 --- a/src/execution/movement.c +++ b/src/execution/movement.c @@ -6,7 +6,7 @@ /* By: aortigos