SoftLEASH game engine logo

WIKI

LUA / LÖVE

SOFTLEASH / DOCUMENTATION

Scene Stack

Organize menus, gameplay, and pause screens as a stack of scenes.

A working outline. The snippets below use plain LÖVE and Lua, not the final SoftLEASH API.

Overview

A scene stack gives each part of a game a clear place to live. A menu can sit above gameplay, while a pause screen can temporarily take control without rebuilding the world underneath.


Use this page to explain scene ownership, update and draw order, and the lifecycle of a scene. Add the real push, pop, and replace operations once the SoftLEASH API is documented.


LÖVE example

A small, plain LÖVE example for the draft. Replace this snippet with the documented SoftLEASH API and a focused use case later.


local g = love.graphics
local paused = false

function love.keypressed(key)
    if key == "space" then
        paused = not paused
    end
end

function love.draw()
    g.print("Gameplay", 32, 32)
    if paused then
        g.print("Paused", 32, 64)
    end
end
local g = love.graphics
local paused = false

function love.keypressed(key)
    if key == "space" then
        paused = not paused
    end
end

function love.draw()
    g.print("Gameplay", 32, 32)
    if paused then
        g.print("Paused", 32, 64)
    end
end
local g = love.graphics
local paused = false

function love.keypressed(key)
    if key == "space" then
        paused = not paused
    end
end

function love.draw()
    g.print("Gameplay", 32, 32)
    if paused then
        g.print("Paused", 32, 64)
    end
end


What to document next

  • Scene creation and lifecycle callbacks.

  • Which scenes receive input, update, and draw calls.

  • Transitions, overlays, and cleanup.

SOFTLEASH / A GO DOG! TOOL

DOCUMENTATION IN PROGRESS

DOCUMENTATION IN PROGRESS