Repository navigation
How The Example Project Works
This page explains what each part of example-project/ is doing and how the pieces connect at runtime.
-
springengine.conf— project boot config -
autoload.dat.conf— persistent/global actors loaded every scene load pass -
input.conf— named input schemas -
*.scene.conf— scene manifests -
*.dat.conf— actor lists used by each scene -
prefabs/*.prefab.conf— reusable actor templates -
lighting/*.lighting.conf+global.lighting.conf— scene lighting selection -
ui/*.ui.conf— UI document definitions -
scripts/*.lua— gameplay and UI behavior -
assets/— textures, sounds, animation definitions
- Boots into
starting_scene.scene.conf. - Sets
autoload_data = "autoload.dat.conf". - Defines scene/prefab/ui roots in
[Paths]. - Declares persistent actor ids:
global_audioinput_routergame_state
Defines three always-available runtime actors:
-
global_audio— audio bus style data -
input_router— input map style data -
game_state— state storage values
They are loaded from Persistence.autoload_actor_ids each time a scene is loaded.
Two input schemas:
-
Normalfor gameplay (Move*,Run,Jump,CloseGame) -
Menufor menu navigation (MoveUp/Down,Confirm,Back)
- Uses
starting_scene.dat.conf. - Selects lighting schema
OutdoorNightfromstarting_scene.lighting.conf. - Loads HUD UI document:
hud.ui.conf. - Spawns actors in explicit order:
- background
- camera
- lights
- player + systems/spawners + trigger + fader
Both use game_over.dat.conf, but different lighting schemas:
-
DarkVoidfordark_scene -
DarkMenuforgame_over
Both load game_over.ui.conf.
Contains the main game actors:
-
starting_background(StaticSprite) -
main_camera(Camera+Script=camera_follow.lua) -
sun_light(DirectionalLight) -
mage_spawner(Script=mage_spawner.lua) -
player_spawn(prefabPlayer+ overrides) -
player_point_light(child of player viaparent = "player_spawn") -
crate_spawner(Script=crate_create.lua) -
scene_fader(StaticColorfullscreen fade) -
fall_reset_trigger(Collidertrigger + script)
Simple menu scene payload:
-
game_over_background(StaticColorfullscreen) -
game_over_controller(Script=game_over.lua) -
game_over_fader(StaticColorfade overlay)
Base player setup:
- transform + centered anchor
- health/motor data
- collider + rigidbody
- script (
scripts/player.lua) - animated sprite (
assets/anims/player.anim.conf)
starting_scene.dat.conf overrides script stack, collider/rigidbody, health, and animation block.
Enemy actor template:
- collider + rigidbody
- script (
scripts/mage.lua) - animated sprite (
assets/anims/mage.anim.conf)
Static prop template:
- collider + rigidbody
- script (
scripts/crate.lua) - static sprite (
assets/Sprites/crate.jpeg)
Maps scenes to files + default schemas:
-
starting_scene→starting_scene.lighting.conf(OutdoorDaydefault) -
game_over→dark_scene.lighting.conf(DarkMenudefault) -
dark_scene→dark_scene.lighting.conf(DarkVoiddefault)
Defines OutdoorDay and OutdoorNight schemas.
Defines DarkVoid and DarkMenu schemas.
Gameplay HUD with labels for:
- health value/bar
- time survived
- mages cleared/active
Updated at runtime by scripts/ui_hud.lua.
Single message label centered on screen.
Extra UI examples for:
- button callbacks
- layering/front-back control
- dynamic doc interactions
-
player.lua- movement, jumping, damage/death flow
- animation params and flip handling
- fade-to-black transition to
game_over.scene.conf - updates global HUD stats table
-
camera_follow.lua- smooth camera follow to
player_spawn
- smooth camera follow to
-
mage_spawner.lua- periodic
Scene.instantiate_prefab("Mage") - maintains spawned/cleared counters
- periodic
-
mage.lua- seek-and-hit behavior
- calls player script method
take_damage - despawns after pass and increments cleared count on destroy
-
crate_create.lua- spawns a row/floor of crates around player start
-
crate.lua- basic lifecycle logging template
-
fall_reset_trigger.lua- collider trigger damage + reset using player script methods
-
music_start.lua- loads/plays looping music via
Engine.DJ - stores music channel in global state
- loads/plays looping music via
-
ui_hud.lua- reads global stat table and writes UI labels
- includes UI button callback (
on_close_menu_click)
-
game_over.lua- background pulse + fade transitions
- Enter key restart to
starting_scene.scene.conf
- Boot
starting_scene+ autoload actors. - Spawn player/camera/spawners/trigger/lights/background + HUD.
-
mage_spawnerperiodically creates mage prefab instances. -
player.luaandmage.luainteract through script calls and shared actor tags. - On player death,
player.luafades scene and loadsgame_over.scene.conf. -
game_over.luawaits for Enter and loads back intostarting_scene.