Finished first EA Version #1
@@ -23,7 +23,12 @@ public class MoveNode : ProgramNode
|
||||
{
|
||||
robot.Position = pathPoints[0];
|
||||
Vector3I mapIndex = Pathfinding.GetClosestStartPoint(robot.Position);
|
||||
GameData.map[mapIndex.Y].tiles[mapIndex.X, mapIndex.Z].wasVisited = true;
|
||||
Tile tile = GameData.map[mapIndex.Y].tiles[mapIndex.X, mapIndex.Z];
|
||||
if (!tile.wasVisited)
|
||||
{
|
||||
tile.wasVisited = true;
|
||||
tile.ContentNode.Visible = true;
|
||||
}
|
||||
pathPoints.Remove(pathPoints[0]);
|
||||
if (pathPoints.Count <= 0)
|
||||
{
|
||||
|
||||
@@ -88,7 +88,8 @@ public partial class Layer : Node3D
|
||||
{
|
||||
var node = new Node3D
|
||||
{
|
||||
Position = tile.Position
|
||||
Position = tile.Position,
|
||||
Visible = false
|
||||
};
|
||||
decorationRoot.AddChild(node);
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ public partial class Tile
|
||||
|
||||
public void SpawnContent(Dictionary<string, MeshInstance3D> contentMeshes, Transform3D transform, List<Placeholder> placeholders)
|
||||
{
|
||||
if(!wasVisited) return;
|
||||
foreach (Placeholder placeholder in placeholders)
|
||||
{
|
||||
if (containsLight && placeholder.name == "light") SpawnLight(contentMeshes["light"], placeholder, transform);
|
||||
|
||||
@@ -90,7 +90,7 @@ public partial class World : Node3D
|
||||
{
|
||||
Robot robot = ResourceLoader.LoadRobotPrefab().Instantiate<Robot>();
|
||||
robot.Name = $"Robot #{robots.Count + 1}";
|
||||
robot.Position = map[0].tiles[0,0].Position;
|
||||
robot.Position = map[0].tiles[0, 0].Position;
|
||||
AddChild(robot);
|
||||
robots.Add(robot);
|
||||
}
|
||||
@@ -113,10 +113,16 @@ public partial class World : Node3D
|
||||
|
||||
map[layer] = layerNode;
|
||||
}
|
||||
map[0].tiles[0,0].wasVisited = true;
|
||||
map[0].tiles[0,0].containsDecoration = true;
|
||||
map[0].tiles[0,0].containsLight = true;
|
||||
map[0].tiles[0,0].containsResource = false;
|
||||
SetupSpawn();
|
||||
}
|
||||
|
||||
private void SetupSpawn()
|
||||
{
|
||||
map[0].tiles[0, 0].wasVisited = true;
|
||||
map[0].tiles[0, 0].containsDecoration = true;
|
||||
map[0].tiles[0, 0].containsLight = true;
|
||||
map[0].tiles[0, 0].containsResource = false;
|
||||
map[0].tiles[0, 0].ContentNode.Visible = true;
|
||||
}
|
||||
|
||||
private void HandleTileVisit(int level)
|
||||
|
||||
Reference in New Issue
Block a user