Finished first EA Version #1
@@ -92,9 +92,13 @@ public partial class CodingWindow : PanelContainer
|
|||||||
string errorMessage = "";
|
string errorMessage = "";
|
||||||
bool didCompile;
|
bool didCompile;
|
||||||
|
|
||||||
for (int i = 1; i < editorWindow.GetChildCount(); i++)
|
for (int i = 0; i < editorWindow.GetChildCount(); i++)
|
||||||
{
|
{
|
||||||
editorWindow.GetChild<NodeDisplay>(i - 1).node.LinkNode(editorWindow.GetChild<NodeDisplay>(i).node);
|
if (i + 1 < editorWindow.GetChildCount())
|
||||||
|
{
|
||||||
|
editorWindow.GetChild<NodeDisplay>(i).node.LinkNode(editorWindow.GetChild<NodeDisplay>(i + 1).node);
|
||||||
|
}
|
||||||
|
editorWindow.GetChild<NodeDisplay>(i).node.ReadParameters(editorWindow.GetChild<NodeDisplay>(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgramInterpreter interpreter = new ProgramInterpreter(editorWindow.GetChild<NodeDisplay>(0).node);
|
ProgramInterpreter interpreter = new ProgramInterpreter(editorWindow.GetChild<NodeDisplay>(0).node);
|
||||||
|
|||||||
@@ -18,4 +18,9 @@ public class CraftNode : ProgramNode
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void ReadParameters(NodeDisplay display)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -18,4 +18,9 @@ public class HarvestNode : ProgramNode
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void ReadParameters(NodeDisplay display)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -3,14 +3,16 @@ using Godot;
|
|||||||
public class MoveNode : ProgramNode
|
public class MoveNode : ProgramNode
|
||||||
{
|
{
|
||||||
public Vector3 startPosition;
|
public Vector3 startPosition;
|
||||||
public Vector3 targetPosition;
|
public Vector3I targetPosition;
|
||||||
public MoveNode()
|
public MoveNode()
|
||||||
{
|
{
|
||||||
DisplayText = "Move";
|
DisplayText = "Move";
|
||||||
}
|
}
|
||||||
public override bool Execute(Robot robot)
|
public override bool Execute(Robot robot)
|
||||||
{
|
{
|
||||||
robot.Position = targetPosition;
|
startPosition = robot.Position;
|
||||||
|
GD.Print(targetPosition);
|
||||||
|
robot.Position = GameData.map[targetPosition.Y].tiles[targetPosition.X, targetPosition.Z].Position;
|
||||||
if (nextNode != null)
|
if (nextNode != null)
|
||||||
{
|
{
|
||||||
return nextNode.Execute(robot);
|
return nextNode.Execute(robot);
|
||||||
@@ -20,4 +22,17 @@ public class MoveNode : ProgramNode
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void ReadParameters(NodeDisplay display)
|
||||||
|
{
|
||||||
|
HBoxContainer valueContainer = display.GetNode<HBoxContainer>("./EditorDisplay/HBoxContainer/");
|
||||||
|
|
||||||
|
GD.Print(valueContainer.GetNode<SpinBox>("./CoordinateX").Value);
|
||||||
|
int posX = (int)valueContainer.GetNode<SpinBox>("./CoordinateX").Value;
|
||||||
|
int posY = (int)valueContainer.GetNode<SpinBox>("./CoordinateY").Value;
|
||||||
|
int posZ = (int)valueContainer.GetNode<SpinBox>("./CoordinateZ").Value;
|
||||||
|
targetPosition = new Vector3I(posX, posY, posZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ public abstract class ProgramNode
|
|||||||
}
|
}
|
||||||
|
|
||||||
public abstract bool Execute(Robot robot);
|
public abstract bool Execute(Robot robot);
|
||||||
|
public abstract void ReadParameters(NodeDisplay display);
|
||||||
public void LinkNode(ProgramNode nextNode)
|
public void LinkNode(ProgramNode nextNode)
|
||||||
{
|
{
|
||||||
this.nextNode = nextNode;
|
this.nextNode = nextNode;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Godot;
|
|||||||
|
|
||||||
public partial class GameData
|
public partial class GameData
|
||||||
{
|
{
|
||||||
|
public static Layer[] map;
|
||||||
//Current layer the player wants to see
|
//Current layer the player wants to see
|
||||||
public static int currentLayer = 0;
|
public static int currentLayer = 0;
|
||||||
//The layer that is currently visible
|
//The layer that is currently visible
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ public partial class World : Node3D
|
|||||||
PackedScene layerPrefab = ResourceLoader.LoadLayerPrefab();
|
PackedScene layerPrefab = ResourceLoader.LoadLayerPrefab();
|
||||||
private Dictionary<string, MultiMeshInstance3D> multiMeshes = new();
|
private Dictionary<string, MultiMeshInstance3D> multiMeshes = new();
|
||||||
private Dictionary<string, Mesh> meshLibrary = new();
|
private Dictionary<string, Mesh> meshLibrary = new();
|
||||||
Layer[] map;
|
|
||||||
Layer layerNode;
|
Layer layerNode;
|
||||||
|
|
||||||
private MultiMeshHandler multiMeshHandler;
|
private MultiMeshHandler multiMeshHandler;
|
||||||
|
|||||||
Reference in New Issue
Block a user