Added mechanic that the gate blocks switching to another layer, added map button, moved small parts to fit buttons.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user