Crystalline-awakening/levels/levelThree/exit_zone3.gd

17 lines
447 B
GDScript

extends Area2D
var planetThree = preload("res://planets/planetThree/planetThree.tscn")
var activated: bool = false
func _ready() -> void:
var scoreBar = get_tree().root.find_child("ProgressBar", true, false)
scoreBar.connect("complete", Callable(self, "levelComplete"))
func levelComplete():
activated = true
print("exit active")
func _on_body_entered(body: Node2D) -> void:
if activated:
get_tree().change_scene_to_packed(planetThree)