Added mechanic that the gate blocks switching to another layer, added map button, moved small parts to fit buttons.

This commit is contained in:
=
2026-05-02 20:08:18 +02:00
parent a2c35c44cb
commit 7f13505759
9 changed files with 111 additions and 67 deletions
+9 -10
View File
@@ -46,6 +46,14 @@ public partial class World : Node3D
Pathfinding.BuildAStarGraph();
HandleRenderData(BuildRenderData(0));
//TODO: Remove for live build -> DEBUG ONLY
Robot robot = ResourceLoader.LoadRobotPrefab().Instantiate<Robot>();
robot.Name = $"Robot #{robots.Count + 1}";
robot.Position = map[0].tiles[0, 0].Position;
AddChild(robot);
robots.Add(robot);
}
private Dictionary<string, MultiMeshInstance3D> CreateMultiMeshes(Dictionary<string, Mesh> meshLibrary)
@@ -78,22 +86,13 @@ public partial class World : Node3D
{
if (!canMove) return;
if (Input.IsActionJustPressed("layer_up") && currentLayer > 0) currentLayer--;
if (Input.IsActionJustPressed("layer_down") && currentLayer < ruinSize - 1) currentLayer++;
if (Input.IsActionJustPressed("layer_down") && currentLayer < ruinSize - 1 && map[currentLayer].isGateOpen) currentLayer++;
if (currentLayer != visibleLayer)
{
map[visibleLayer].ClearDecorations();
HandleRenderData(BuildRenderData(currentLayer));
visibleLayer = currentLayer;
}
if (Input.IsActionJustPressed("spawn_robot") && robots.Count < maxRobotCount)
{
Robot robot = ResourceLoader.LoadRobotPrefab().Instantiate<Robot>();
robot.Name = $"Robot #{robots.Count + 1}";
robot.Position = map[0].tiles[0, 0].Position;
AddChild(robot);
robots.Add(robot);
}
}
private void GenerateWorld()