This repository has been archived on 2025-09-12. You can view files and clone it, but cannot push or open issues or pull requests.
ld49/game/autoloads/ScenesRepo.gd

19 lines
416 B
GDScript

extends Node
#Repository to manage scene changes
#Supposed to be called after fading or effects
enum {main_menu, credits}
var scenes:Dictionary = {
main_menu:"res://game/menu/MainMenu.tscn",
credits:"",
}
func change_scene_to(id:int) -> bool:
if !(id in scenes.keys()):
printerr("Error, the scene id does not exist")
return false
ErrorHandler.handle(get_tree().change_scene_to(scenes[id]))
return true