From 05cf88d9861a8e4c7a34255432c46609cc123c4d Mon Sep 17 00:00:00 2001 From: Asuro Date: Sat, 21 Jun 2025 11:06:05 +0200 Subject: [PATCH] fixes --- src/game/Level.cpp | 10 ++++++---- src/game/Level.h | 1 - src/game/Tools.cpp | 5 +++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/game/Level.cpp b/src/game/Level.cpp index c33e22c..20700db 100644 --- a/src/game/Level.cpp +++ b/src/game/Level.cpp @@ -279,13 +279,13 @@ namespace Game } return height >= 110 && height <= 125; } - if (offsetX >= 0 && offsetX < puz.Data.WidthTiles / Puzzle::Config::CardSize && - offsetY == puz.Data.HeightTiles / Puzzle::Config::CardSize) + if (offsetX == 1 && offsetY == puz.Data.HeightTiles / Puzzle::Config::CardSize) { if (puz.IsSolved) { return true; } + return true; // TODO! } } return false; @@ -596,11 +596,13 @@ namespace Game } auto& wall = level.PuzzleTiles.Get(WallHandle); wall.EData.Visible = true; - wall.EData.Transform.Position = WorldPosition + Vec3{30.0f, -5.0f, 40.2f}; + wall.EData.Transform.Position = + WorldPosition + Vec3{0.0f, 0.0f, Data.HeightTiles * 5.0f} + Vec3{30.0f, -5.0f, 0.2f}; auto& door = level.PuzzleTiles.Get(DoorHandle); door.EData.Visible = !IsSolved; - door.EData.Transform.Position = WorldPosition + Vec3{30.0f, -5.0f, 40.2f}; + door.EData.Transform.Position = + WorldPosition + Vec3{0.0f, 0.0f, Data.HeightTiles * 5.0f} + Vec3{30.0f, -5.0f, 0.2f}; } void Level::ReloadLevelEntities() diff --git a/src/game/Level.h b/src/game/Level.h index 6227d8b..a7df321 100644 --- a/src/game/Level.h +++ b/src/game/Level.h @@ -27,7 +27,6 @@ namespace Game void Setup(); void Update(); - void Reset(); // TODO! }; class Level diff --git a/src/game/Tools.cpp b/src/game/Tools.cpp index 3f6a4d5..a482e64 100644 --- a/src/game/Tools.cpp +++ b/src/game/Tools.cpp @@ -668,6 +668,11 @@ namespace Tools { if (ImGui::Button("Spiel Neustarten")) { + player.PlayerCamTransform.Position = {0.0f, 3.0f, 0.0f}; + for (int32_t i = 0; i < BX_COUNTOF(level.Puzzles); ++i) + { + Puzzle::ResetPuzzle(level.Puzzles[i].Data); + } } ImGui::SameLine(); if (ImGui::Button("Zurück zum Anfang"))