Skip to content

Instantly share code, notes, and snippets.

@NovemberDev
NovemberDev / godot_async_scene_loader.gd
Last active March 12, 2025 16:00
Asynchronously loads scenes in godot
# Loads a scene in the background using a seperate thread and a queue.
# Foreach new scene there will be an instance of ResourceInteractiveLoader
# that will raise an on_scene_loaded event once the scene has been loaded.
# Hooking the on_progress event will give you the current progress of any
# scene that is being processed in realtime. The loader also uses caching
# to avoid duplicate loading of scenes and it will prevent loading the
# same scene multiple times concurrently.
#
# Sample usage:
#
@NovemberDev
NovemberDev / godot_finite_state_machine.gd
Last active October 5, 2021 12:09
Godot Finite state machine script / class in one file
# godot_finite_state_machine.gd
# by: @november_dev
#
# The finite state machine takes in a number of states and transitions.
#
# A state can contain a function that will be executed or looped while the state is active.
#
# The transition gets a function that returns a boolean truthiness value, which determines
# if the transition should happen or not.
#