using Godot; using System.Linq; public partial class BoardScreen : Node2D { [Export] private AudioStream endingSfx; [Export] private Theme theme; private const string RED_CHIP_PATH = "res://scenes/red_chip.tscn"; private const string YELLOW_CHIP_PATH = "res://scenes/yellow_chip.tscn"; private const string BRACKET_SCENE_PATH = "res://scenes/bracket_view.tscn"; private const int CHIP_SCALE = 3; private const int CHIP_SIZE = 24; private const int CHIP_PADDING = 2; private const int CHIP_X_OFF = -(CHIP_SIZE + CHIP_PADDING) * 7 / 2 + (CHIP_SIZE + CHIP_PADDING) / 2; private const int Y_OFF = 300; private const int CARD_CENTER_X_DEFAULT = -536; private const double MOVE_TIMEOUT_BEFORE_PLACE = 1.0f; private double currentTimeout = 0.0f; private PackedScene redChip; private PackedScene ylwChip; private Node2D player1Card; private Node2D player2Card; private MatchData matchData; private RigidBody2D[,] chips = new RigidBody2D[6, 7]; // 6 rows 7 cols | 0, 0 is top left private bool _lastMove = false; private float _lastMoveTimer = 2.5f; private string _winner = ""; // Called when the node enters the scene tree for the first time. public override void _Ready() { // Node initialization player1Card = GetNode("Player1Card"); player2Card = GetNode("Player2Card"); player1Card.GetNode