Behaviour

Defines how an Actor moves etc.

An Actor's behaviour can change, the classic example is Pac-Man ghosts : At first they are trying to catch Pac-Man, but when a power-pellet is eaten, they change behaviour and flee.

You could implement this ghost-like behaviour with a big if in a single Behaviour, or have one Behaviour for chasing, and another for fleeing. Set Actor.behaviour when a power-pellet is eaten, and reset it when it wears off. I prefer the latter, YMMV.

Inheritors

Functions

Link copied to clipboard
open fun customProperties(): List<Property<*>>

Third party implementation of Role and Director can expose properties that can be edited in Kyd's editor.

Link copied to clipboard
open fun onActStarted(actor: Actor)
Link copied to clipboard
open fun onEnteredStage(actor: Actor)
Link copied to clipboard
open fun onExitedStage(actor: Actor, oldStage: Stage)
Link copied to clipboard
open fun tick(actor: Actor, seconds: Float)