Friday, 08 August 2025 02:54:15
This commit is contained in:
@@ -133,11 +133,24 @@ public partial class Manager : Node
|
||||
}
|
||||
else if (_selectedNode is BallSprite)
|
||||
{
|
||||
|
||||
Vector2 mousePosition = GetViewport().GetMousePosition();
|
||||
((BallSprite)_selectedNode).Position = mousePosition;
|
||||
if (Input.IsActionJustReleased("left_click"))
|
||||
{
|
||||
if (!_table._kitchenHovered)
|
||||
{
|
||||
PlaceBall(((BallSprite)_selectedNode), mousePosition);
|
||||
_hoveredNode = null;
|
||||
_selectedNode = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_hoveredNode is BallSprite)
|
||||
{
|
||||
|
||||
if (Input.IsActionJustReleased("left_click"))
|
||||
{
|
||||
_selectedNode = (BallSprite)_hoveredNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -256,6 +269,7 @@ public partial class Manager : Node
|
||||
ball._placed = true;
|
||||
ball._potted = false;
|
||||
ball._active = true;
|
||||
ball.Rotation = 0;
|
||||
|
||||
if (!GetChildren().Contains(ball))
|
||||
{
|
||||
@@ -291,7 +305,16 @@ public partial class Manager : Node
|
||||
|
||||
BallSprite ballSprite = GetSpriteFromBall(BALL);
|
||||
int pottedCount = _ballReturn._returnCount;
|
||||
ballSprite.Position = new Vector2(_ballReturn.GlobalPosition.X + _ballReturn.Size.X / 2, _ballReturn.GlobalPosition.Y + 50 * (pottedCount + 1));
|
||||
Vector2 position;
|
||||
if (BALL._isCue)
|
||||
{
|
||||
position = _kitchen.GlobalPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
position = new Vector2(_ballReturn.GlobalPosition.X + _ballReturn.Size.X / 2, _ballReturn.GlobalPosition.Y + 50 * (pottedCount + 1));
|
||||
}
|
||||
ballSprite.Position = position;
|
||||
ballSprite._active = true;
|
||||
if (!GetChildren().Contains(ballSprite))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user