diff options
Diffstat (limited to 'scripts/basketball.gd')
-rw-r--r-- | scripts/basketball.gd | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/basketball.gd b/scripts/basketball.gd index f36fa44..31d082a 100644 --- a/scripts/basketball.gd +++ b/scripts/basketball.gd @@ -86,3 +86,13 @@ func _on_InnerShape_mouse_entered(): ready_to_hold = true func _on_InnerShape_mouse_exited(): ready_to_hold = false + +func position_changer(): + if global_variables.score < 5: + start_position.x -= 20 + start_position.x = clamp(start_position.x, 30, 123) + else: + start_position.x = rand_range(30, 123) + +func _on_Hoop_score(): + position_changer() |