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