fsm
A small finite state machine. `FSM.define(name, { initial, states, transitions })` checks and names a definition; `FSM.new(def, ctx)` makes a machine whose `update(dt)` runs global transitions, then the current state's `update`, which can return the next state's name. `enter`, `e…
aiKit.fsm
A small finite state machine. FSM.define(name, { initial, states, transitions }) checks and names a definition; FSM.new(def, ctx) makes a machine whose update(dt) runs global transitions, then the current state's update, which can return the next state's name. enter, exit and label per state; machine.state, machine.time, machine:go(name, reason). The guard, wanderer, chaser, coward, ambusher, turret, sentry and listener brains are written with it; games use it through AI.fsm or AI.defineBrain.
Scoped to this part · feeds back into the world's score.