using Godot; using EinSoftworks.Utilities; using EinSoftworks.Input; namespace TestGame { public partial class Main : Node2D { private InputManager _inputManager; private Label _statusLabel; private Label _inputStatusLabel; public override void _Ready() { GD.Print("Test Game Started!"); // Test the utilities library TestMathUtils(); // Initialize input manager _inputManager = new InputManager(); AddChild(_inputManager); // Create UI labels for testing CreateTestUI(); // Connect to input events _inputManager.ActionPressed += OnActionPressed; _inputManager.ActionReleased += OnActionReleased; } public override void _Process(double delta) { TestInputSystem(); } private void TestMathUtils() { // Test degree/radian conversion float testAngle = 90f; float radians = MathUtils.DegreesToRadians(testAngle); float backToDegrees = MathUtils.RadiansToDegrees(radians); GD.Print($"90° → {radians} rad → {backToDegrees}°"); // Test clamping float clampedValue = MathUtils.Clamp01(1.5f); GD.Print($"Clamped 1.5 to 0-1 range: {clampedValue}"); // Test approximation bool isApprox = MathUtils.Approximately(0.1f, 0.100001f); GD.Print($"0.1 ≈ 0.100001: {isApprox}"); } private void CreateTestUI() { // Main status label (existing) _statusLabel = GetNode