7-16-25 @ 3:27AM
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
public partial class Actor : Node
|
||||
{
|
||||
public bool _available, _hovered, _selected;
|
||||
public CollisionShape2D _startArea;
|
||||
public List<Cue> _cues = new();
|
||||
public Cue _selectedCue = null;
|
||||
public List<Ball> _balls = new();
|
||||
@@ -45,7 +46,6 @@ public partial class Actor : Node
|
||||
{
|
||||
if (_ballBag.Count > 0)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
if (_heldBall == null)
|
||||
{
|
||||
_heldBall = _ballBag[0];
|
||||
@@ -67,10 +67,15 @@ public partial class Actor : Node
|
||||
}
|
||||
_tempBallSprite.Texture = _heldBall.GetNode<Sprite2D>("Image").Texture;
|
||||
}
|
||||
_tempBallSprite.Position = mousePosition;
|
||||
if (_startArea == null)
|
||||
{
|
||||
_startArea = Globals.Instance._currentBattle.GetNode<Table>("Table").GetNode<Area2D>("PlayerStartArea").GetNode<CollisionShape2D>("CollisionShape2D");
|
||||
}
|
||||
|
||||
_tempBallSprite.Position = new Vector2(Math.Min(Math.Max(mousePosition.X, _startArea.GlobalPosition.X - ((RectangleShape2D)(_startArea.Shape)).Size.X / 2), _startArea.GlobalPosition.X + ((RectangleShape2D)(_startArea.Shape)).Size.X / 2), Math.Min(Math.Max(mousePosition.Y, _startArea.GlobalPosition.Y - ((RectangleShape2D)(_startArea.Shape)).Size.Y / 2), _startArea.GlobalPosition.Y + ((RectangleShape2D)(_startArea.Shape)).Size.Y / 2));
|
||||
if (Input.IsActionJustReleased("left_click"))
|
||||
{
|
||||
_heldBall.Place(mousePosition);
|
||||
_heldBall.Place(_tempBallSprite.Position);
|
||||
AddChild(_heldBall);
|
||||
int ballIndex = _ballBag.IndexOf(_heldBall);
|
||||
_ballBag.Remove(_heldBall);
|
||||
@@ -79,15 +84,6 @@ public partial class Actor : Node
|
||||
{
|
||||
_heldBall = _ballBag[ballIndex - (ballIndex > _ballBag.Count ? 1 : 0)];
|
||||
}
|
||||
=======
|
||||
_activeCue.HideCue();
|
||||
Vector2 mousePosition = GetViewport().GetMousePosition();
|
||||
GetNode<Marker2D>("StartPosition").Position = mousePosition;
|
||||
if (Input.IsActionJustReleased("left_click"))
|
||||
{
|
||||
_activeBall.Place(GetNode<Marker2D>("StartPosition").Position);
|
||||
GD.Print(_activeBall.Position);
|
||||
>>>>>>> 920c5c27fb732c902987b01dcc093e55b1552a9f
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -110,25 +106,21 @@ public partial class Actor : Node
|
||||
{
|
||||
if (Input.IsActionJustReleased("left_click"))
|
||||
{
|
||||
GD.Print(_selectedBall);
|
||||
_selectedBall = _hoveredBall;
|
||||
_selectedBall._selected = true;
|
||||
_selectedCue.Don(_selectedBall);
|
||||
GD.Print(_selectedBall);
|
||||
}
|
||||
}
|
||||
else if (Input.IsActionJustReleased("right_click"))
|
||||
{
|
||||
GD.Print(2);
|
||||
_selectedBall._selected = false;
|
||||
_selectedBall = null;
|
||||
_selectedCue.Doff();
|
||||
}
|
||||
else if (_hoveredBall == null)
|
||||
{
|
||||
if (Input.IsActionJustReleased("left_click") && _selectedCue._power == 0)
|
||||
if (Input.IsActionJustReleased("left_click") && _selectedBall != null && _selectedCue._power == 0)
|
||||
{
|
||||
GD.Print(3);
|
||||
_selectedBall._selected = false;
|
||||
_selectedBall = null;
|
||||
_selectedCue.Doff();
|
||||
|
||||
Reference in New Issue
Block a user