Test for calling method of Node.

This commit is contained in:
gdz
2025-08-26 18:22:25 +02:00
parent 50cea7f096
commit ffaee18654
3 changed files with 27 additions and 127 deletions

View File

@@ -13,15 +13,18 @@ public partial class Main : Node
screenSize = GetViewport().GetVisibleRect().Size;
camera = GetNode<Camera2D>("GlobalCamera");
spawner = GetNode("World/Spawner");
GetNode<Node2D>("Grid").Call("generateGrid");
Node2D grid = GetNode<Node2D>("World/Grid");
camera.Position = new Vector2(screenSize.X / 2, screenSize.Y / 2);
var flyPosition = camera.Position;
spawner.Call("spawn_fly", flyPosition);
Node2D fly = (Node2D)spawner.GetChild(0);
GD.Print(grid.Call("worldToGrid", fly.Position));
GetNode<MarginContainer>("HUD").Call("buildInfoPanel", (Node)fly);
GetNode<MarginContainer>("HUD").Call("ShowInfoPanel");
}
}