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
+6 -3
View File
@@ -13,11 +13,14 @@ public partial class Map : PanelContainer
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
public void ShowMap()
{
Visible = !Visible;
if (!Visible) return;
foreach (Node node in grid.GetChildren())
{
grid.RemoveChild(node);
@@ -45,7 +48,7 @@ public partial class Map : PanelContainer
{
label.Text = "\u2193 Z | \u2192 X";
}
else if(z == -1)
else if (z == -1)
{
label.Text = x.ToString();
}
@@ -54,7 +57,7 @@ public partial class Map : PanelContainer
label.Text = z.ToString();
}
grid.AddChild(label);
continue;
continue;
}
texture = new TextureRect();
if (tiles[x, z].wasVisited)
+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()