SoftLEASH game engine logo

WIKI

LUA / LÖVE

SOFTLEASH / DOCUMENTATION

Event Board

Let systems communicate without tightly coupling them together.

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

Overview

An event board gives gameplay events a shared place to travel. Objects can announce that something happened, while interested systems decide how to respond.


Document the event names, payload conventions, listener lifetime, and dispatch order here. The example only demonstrates a standard LÖVE input callback, not an engine event API.


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 message = "Press any key"

function love.keypressed(key)
    message = "Pressed: " .. key
end

function love.draw()
    love.graphics.print(
        message, 32, 32
    )
end
local message = "Press any key"

function love.keypressed(key)
    message = "Pressed: " .. key
end

function love.draw()
    love.graphics.print(
        message, 32, 32
    )
end
local message = "Press any key"

function love.keypressed(key)
    message = "Pressed: " .. key
end

function love.draw()
    love.graphics.print(
        message, 32, 32
    )
end


What to document next

  • Registering and removing listeners.

  • Payloads and event naming conventions.

  • Immediate versus queued dispatch.

SOFTLEASH / A GO DOG! TOOL

DOCUMENTATION IN PROGRESS

DOCUMENTATION IN PROGRESS