connections

This commit is contained in:
2026-05-20 16:34:39 +02:00
parent 70bba45b8a
commit 661e62e8b8
35 changed files with 1039 additions and 258 deletions

30
Root.cs Normal file
View File

@@ -0,0 +1,30 @@
using Godot;
using GodotUtilities;
namespace NodeWar;
[Scene]
public partial class Root : Node2D
{
[Node]
private Line2D line2D;
public override void _Ready()
{
GD.Print(line2D);
}
public void ConnectNodules(Nodule a, Nodule b)
{
GlobalPosition = a.GlobalPosition;
line2D.Points = [Vector2.Zero, b.GlobalPosition - a.GlobalPosition];
}
public override void _Notification(int what)
{
if (what == NotificationSceneInstantiated)
{
WireNodes();
}
}
}