Thursday, 11 September 2025 02:29:56

This commit is contained in:
2025-09-11 02:29:59 -04:00
parent 23700e2bcf
commit 36ce21cb44
4 changed files with 21 additions and 26 deletions

View File

@@ -15,16 +15,12 @@ public partial class Desk : Node2D
_dark = GetNode<Sprite2D>("Dark");
_cellDimensions = new Vector2(50, 50);
_gridDimensions = new Vector2(10, 20);
_topLeft = Globals.Instance._screenCenter - _cellDimensions * _gridDimensions / 2 + _cellDimensions / 2;
GD.Print(_topLeft);
Setup();
}
public Vector2 GetPositionFromAddress(int ROW, int COLUMN)
{
if (_grid.HasNode("R" + ROW))
{
Node2D row = _grid.GetNode<Node2D>("R" + ROW);
@@ -37,8 +33,10 @@ public partial class Desk : Node2D
return new Vector2(-1, -1);
}
public void Setup()
public void Setup(int ROWS, int COLUMNS)
{
_gridDimensions = new Vector2(COLUMNS, ROWS);
_topLeft = Globals.Instance._screenCenter - _cellDimensions * _gridDimensions / 2 + _cellDimensions / 2;
Vector2 position;
Node2D row;
Sprite2D column;