summaryrefslogtreecommitdiff
path: root/scripts/hoop.gd
blob: dc43cc1ec4cc6767a3ffa4a7cf2303f02486a26c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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")