diff options
-rw-r--r-- | scripts/basketball.gd | 2 | ||||
-rw-r--r-- | scripts/global_variables.gd | 1 | ||||
-rw-r--r-- | scripts/hoop.gd | 3 |
3 files changed, 1 insertions, 5 deletions
diff --git a/scripts/basketball.gd b/scripts/basketball.gd index e0c6b3b..cc9dfa6 100644 --- a/scripts/basketball.gd +++ b/scripts/basketball.gd @@ -72,7 +72,7 @@ func _on_InnerShape_mouse_exited(): func position_changer(): var clamp_minimum = drag_radius + 0 - var clamp_maximum = global_variables.hoop_position - 40 + var clamp_maximum = $"../Hoop".position.x - 40 if global_variables.score < 5: start_position.x -= 20 start_position.x = clamp(start_position.x, clamp_minimum, clamp_maximum) diff --git a/scripts/global_variables.gd b/scripts/global_variables.gd index b48e077..f0702e6 100644 --- a/scripts/global_variables.gd +++ b/scripts/global_variables.gd @@ -2,4 +2,3 @@ extends Node var score = 0 var has_scored = false -var hoop_position diff --git a/scripts/hoop.gd b/scripts/hoop.gd index aba0b2b..6faaa66 100644 --- a/scripts/hoop.gd +++ b/scripts/hoop.gd @@ -2,9 +2,6 @@ extends StaticBody2D signal score -func _ready(): - global_variables.hoop_position = position.x - func _on_Area2D_body_exited(_body): # Prevent scoring multiple points with one basketball throw. if !global_variables.has_scored: |