-
Notifications
You must be signed in to change notification settings - Fork 25
Game Systems
These are all the pre-loaded nodes this project contains.
This node handles all transitions between scenes, with or without screen transitions.
A scene transition is a node that is instantiated when a scene is changed by the SceneTransitionManager
. It hides fades in to hide the scene, triggers the actual scene change then fades out. Here's how you can create your own:
- Create a
Transition
node with anAnimationPlayer
child, and specify the "Animation" property on theTransition
node
- Add two animations to the animation player, these must be named
FadeIn
andFadeOut
- The
FadeIn
animation must start with a completely hidden screen on the first frame, and completely visible on the last frame. - The
FadeOut
animation should have the opposite behavior: visible on first frame, hidden on the last. Make sure the first frame ofFadeIn
is identical to the last one ofFadeOut
! You will find some examples onres://scenes/scene_transitions/
.
You now have your own transition! You can now using when changing scenes by calling:
SceneTransitionManager.change_scene_with_transition(new_scene, transition_scene)
SaveManager
nodes handles saving and loading game state.
All nodes that should be saved must be added to a "Saveable" group. Note that there is no need to define any serialization methods on the nodes, all exported properties will automatically be saved to the save file, with some exceptions (
-
Object
type properties
Saving can be done by calling the following method
SaveManager.save_game()
This will save the name of the current scene and the state of all nodes in the "Saveable" group in that scene
Loading can be done by calling the following method
SaveManager.load_game()
This will first transition the the scene specified in the save file, and then load all the saved data for nodes in the "Saveable" group.
On loading the game, a scene change is triggered using a specific transition. Should you want to change that transition, you can do that by editing the save manager scene here: res://scenes/preloads/save_manager.tscn
TODO