SoftLEASH game engine logo

WIKI

LUA / LÖVE

SOFTLEASH / DOCUMENTATION

Components

Compose game objects from small, focused pieces of behavior.

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

Overview

Components give an object capabilities without making every object responsible for everything. A movement component, visual component, or interaction component can keep its work focused.


Document how components attach to objects, receive lifecycle callbacks, and find other components. Use this space for the actual SoftLEASH composition patterns and constraints.


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 obj = { x = 40, y = 100 }
local vel = { x = 60, y = 0 }

function love.update(dt)
    obj.x = obj.x + vel.x * dt
    obj.y = obj.y + vel.y * dt
end

function love.draw()
    g.circle(
        "fill", obj.x, obj.y, 12
    )
end
local g = love.graphics
local obj = { x = 40, y = 100 }
local vel = { x = 60, y = 0 }

function love.update(dt)
    obj.x = obj.x + vel.x * dt
    obj.y = obj.y + vel.y * dt
end

function love.draw()
    g.circle(
        "fill", obj.x, obj.y, 12
    )
end
local g = love.graphics
local obj = { x = 40, y = 100 }
local vel = { x = 60, y = 0 }

function love.update(dt)
    obj.x = obj.x + vel.x * dt
    obj.y = obj.y + vel.y * dt
end

function love.draw()
    g.circle(
        "fill", obj.x, obj.y, 12
    )
end


What to document next

  • Attaching and removing components.

  • Lifecycle order and dependencies.

  • Sharing data without unnecessary coupling.

SOFTLEASH / A GO DOG! TOOL

DOCUMENTATION IN PROGRESS

DOCUMENTATION IN PROGRESS