launcher.gd 233 B

1234567891011121314
  1. extends Button
  2. @export var level: PackedScene
  3. func _on_pressed():
  4. launch_level()
  5. func launch_level():
  6. assert(level, "A level must be specified in the editor")
  7. var err = get_tree().change_scene_to_packed(level)
  8. assert(!err)