This commit is contained in:
2025-07-14 18:14:48 -04:00
parent 3841984183
commit 920c5c27fb
5 changed files with 7 additions and 6 deletions

View File

@@ -41,11 +41,13 @@ public partial class Actor : Node
{ {
if (!_activeBall._placed) if (!_activeBall._placed)
{ {
_activeCue.HideCue();
Vector2 mousePosition = GetViewport().GetMousePosition(); Vector2 mousePosition = GetViewport().GetMousePosition();
_activeBall.Position = mousePosition; GetNode<Marker2D>("StartPosition").Position = mousePosition;
if (Input.IsActionJustReleased("left_click")) if (Input.IsActionJustReleased("left_click"))
{ {
_activeBall.Place(mousePosition); _activeBall.Place(GetNode<Marker2D>("StartPosition").Position);
GD.Print(_activeBall.Position);
} }
} }
else else

View File

@@ -47,6 +47,7 @@ public partial class Ball : RigidBody2D
} }
else if (LinearVelocity.Length() >= _moveThreshold) else if (LinearVelocity.Length() >= _moveThreshold)
{ {
GD.Print(Position);
if (!_moving) if (!_moving)
{ {
_moving = true; _moving = true;

View File

@@ -88,13 +88,11 @@ public partial class Battle : Node
} }
if (BODY == _player._actor._activeBall) if (BODY == _player._actor._activeBall)
{ {
GD.Print(1);
_player._actor._activeBall._potted = true; _player._actor._activeBall._potted = true;
_player._actor._activeBall._placed = false; _player._actor._activeBall._placed = false;
} }
else else
{ {
GD.Print(BODY);
Sprite2D ballSprite = new Sprite2D(); Sprite2D ballSprite = new Sprite2D();
AddChild(ballSprite); AddChild(ballSprite);
ballSprite.Texture = BODY.GetNode<Sprite2D>("Image").Texture; ballSprite.Texture = BODY.GetNode<Sprite2D>("Image").Texture;

View File

@@ -4,3 +4,5 @@
[node name="Actor" type="Node"] [node name="Actor" type="Node"]
script = ExtResource("1_hr3hk") script = ExtResource("1_hr3hk")
[node name="StartPosition" type="Marker2D" parent="."]

View File

@@ -23,5 +23,3 @@ offset_top = 678.0
offset_right = 1200.0 offset_right = 1200.0
offset_bottom = 778.0 offset_bottom = 778.0
theme_override_styles/panel = SubResource("StyleBoxFlat_tivnh") theme_override_styles/panel = SubResource("StyleBoxFlat_tivnh")
[connection signal="SetCurrent" from="." to="Player" method="BattleStart"]