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")