17 lines
439 B
GDScript
17 lines
439 B
GDScript
extends Area2D
|
|
|
|
var planetOne = preload("res://planets/planetOne/planetOne.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(planetOne)
|