aboutsummaryrefslogblamecommitdiffstats
path: root/godot/scenes/objects/GoalTriggerBox.gd
blob: 9659520d27813a25b32bca2cef3b6091a3fae98c (plain) (tree)
1
2
3
4
5
6
7
8

            
                                              



                                                                
                                       






                                                                           
                                            



                                             
                          
        
extends Area

const Loader = preload("res://scenes/Game.gd")
var loader: Loader = null

# Called when the node enters the scene tree for the first time.
func _ready():
	loader = get_node("/root/Game")


# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#	pass


func _on_Area_body_entered(body: RigidBody):
	# return when body is not a rigidbody
	if body == null:
		return
	
	loader.end_level()