diff options
author | Logan <logan@cflip.net> | 2022-09-26 11:43:55 -0600 |
---|---|---|
committer | Logan <logan@cflip.net> | 2022-09-26 11:43:55 -0600 |
commit | 7921365f0608ea6840998c04af7286044f077a84 (patch) | |
tree | 189d183590e9f5091d4a9b47adcd28b0735b4ea5 /scripts/hoop.gd | |
parent | ec3b1f444db16ebfbbde48e20be3b92500762a57 (diff) |
Made basketball change position based on hoop's position.
Diffstat (limited to 'scripts/hoop.gd')
-rw-r--r-- | scripts/hoop.gd | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/hoop.gd b/scripts/hoop.gd index 87af280..dc43cc1 100644 --- a/scripts/hoop.gd +++ b/scripts/hoop.gd @@ -2,9 +2,12 @@ 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: + global_variables.has_scored = true global_variables.score += 1 emit_signal ("score") - global_variables.has_scored = true |