SoftLEASH game engine logo

WIKI

LUA / LÖVE

SOFTLEASH / DOCUMENTATION

Object Tree

Build a readable world from parent–child relationships.

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

Overview

An object tree describes how game objects belong together. A player can own a sprite, a collider, and a tool; a scene can own the player and the rest of the level.


Outline how objects are added, removed, traversed, and cleaned up. Use a small hierarchy diagram here to explain the relationship between a parent and its children.


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 parent = { x = 80, y = 80 }
local child = { x = 24, y = 12 }

function love.draw()
    g.rectangle(
        "line", parent.x, parent.y,
        48, 48
    )
    g.circle(
        "fill",
        parent.x + child.x,
        parent.y + child.y, 6
    )
end
local g = love.graphics
local parent = { x = 80, y = 80 }
local child = { x = 24, y = 12 }

function love.draw()
    g.rectangle(
        "line", parent.x, parent.y,
        48, 48
    )
    g.circle(
        "fill",
        parent.x + child.x,
        parent.y + child.y, 6
    )
end
local g = love.graphics
local parent = { x = 80, y = 80 }
local child = { x = 24, y = 12 }

function love.draw()
    g.rectangle(
        "line", parent.x, parent.y,
        48, 48
    )
    g.circle(
        "fill",
        parent.x + child.x,
        parent.y + child.y, 6
    )
end


What to document next

  • Adding and removing child objects.

  • Local versus world coordinates.

  • Traversal order and object lifetime.

SOFTLEASH / A GO DOG! TOOL

DOCUMENTATION IN PROGRESS

DOCUMENTATION IN PROGRESS