summaryrefslogtreecommitdiff
path: root/scripts/basketball.gd
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/basketball.gd')
-rw-r--r--scripts/basketball.gd4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/basketball.gd b/scripts/basketball.gd
index f55bc53..51137e3 100644
--- a/scripts/basketball.gd
+++ b/scripts/basketball.gd
@@ -41,6 +41,7 @@ func _integrate_forces(state):
func _process(delta):
if waiting_for_shoot:
$Sprite.rotation += spin_speed * delta
+ $GhostSprite.rotation += spin_speed * delta
if Input.is_action_pressed("ui_left"):
start_position.x -= move_speed * delta
if Input.is_action_pressed("ui_right"):
@@ -50,6 +51,8 @@ func _process(delta):
func _input(event):
if event.is_action_pressed("shoot") and ready_to_hold:
$Sprite.position = event.position - start_position
+ $GhostSprite.visible = true
+ $GhostSprite.rotation = $Sprite.rotation
is_dragging = true
if is_dragging and event is InputEventMouseMotion:
$Sprite.position = event.position - start_position
@@ -58,6 +61,7 @@ func _input(event):
power = (start_position - event.position) * power_magnitude
$Sprite.position = Vector2()
is_dragging = false
+ $GhostSprite.visible = false
toggle_mode()
func on_OuterShape_mouse_entered():