summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/hoop.gd13
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/hoop.gd b/scripts/hoop.gd
index c74afe6..77de7b4 100644
--- a/scripts/hoop.gd
+++ b/scripts/hoop.gd
@@ -4,12 +4,15 @@ signal score
var has_scored = false
-func _on_Area2D_body_exited(_body):
+func _on_Area2D_body_exited(body):
+ print(body)
+ if body.name == "Basketball":
# Prevent scoring multiple points with one basketball throw.
- if !has_scored and !global_variables.timer_zero:
- global_variables.score += 1
- has_scored = true
- emit_signal ("score")
+ if !has_scored and !global_variables.timer_zero:
+ print("SCORE!!!")
+ global_variables.score += 1
+ has_scored = true
+ emit_signal ("score")
func _on_Basketball_reset():
has_scored = false