summaryrefslogtreecommitdiff
path: root/scripts/hoop.gd
diff options
context:
space:
mode:
authorLogan <logan@cflip.net>2022-09-24 14:06:05 -0600
committerLogan <logan@cflip.net>2022-09-24 14:06:05 -0600
commitd5c6407dd82aaf5fee0c0a6f8d02ff1e9f41df23 (patch)
tree0665afae76271ff09fbd7614b98abfbe797752e6 /scripts/hoop.gd
parent486af6b416637184417ace7adb1bb4db6f243436 (diff)
Prevent over-scoring with basketball.
Diffstat (limited to 'scripts/hoop.gd')
-rw-r--r--scripts/hoop.gd7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/hoop.gd b/scripts/hoop.gd
index 94b3069..87af280 100644
--- a/scripts/hoop.gd
+++ b/scripts/hoop.gd
@@ -3,5 +3,8 @@ extends StaticBody2D
signal score
func _on_Area2D_body_exited(_body):
- global_variables.score += 1
- emit_signal ("score")
+ # Prevent scoring multiple points with one basketball throw.
+ if !global_variables.has_scored:
+ global_variables.score += 1
+ emit_signal ("score")
+ global_variables.has_scored = true