Log inGet started
World

Castaway Isle: Island Survival and Crafting Kit

Branchmain
Branchesmain
Commit2a168afc93

README.md

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.