Fixed up the map generator so that it's placing entities in non-overlapping tiles and adapting the style for the size. It can also deal with maps that have no rooms better and places the stairs better.

This commit is contained in:
Zed A. Shaw 2025-05-22 12:24:59 -04:00
parent 5f1a453fb4
commit 4eaf3c35d6
11 changed files with 55 additions and 45 deletions

View file

@ -15,9 +15,9 @@ Point CameraLOL::plan_move(int dir, bool strafe) {
return {size_t(target_x), size_t(target_y)};
}
void CameraLOL::plan_rotate(int dir) {
void CameraLOL::plan_rotate(int dir, float amount) {
t = 0.0;
double angle_dir = std::numbers::pi * 0.25 * dir;
double angle_dir = std::numbers::pi * amount * float(dir);
target_dir_x = rayview.$dir_x * cos(angle_dir) - rayview.$dir_y * sin(angle_dir);
target_dir_y = rayview.$dir_x * sin(angle_dir) + rayview.$dir_y * cos(angle_dir);