AM_Behavioral

AM_Behavioral

Extends an actor to use behaviors.

Methods

# startBehavior(behavior, optionsopt)

Sets the actor's top-level behavior. Usually this is only done during the actor's init() routine. The actor only has one top level behavior. Starting a new behavior will delete the previous one.

Parameters:
Name Type Attributes Description
behavior Behavior

The actor's top-level behavior

options Object <optional>

An optional options object that will be passed to the behavior when it starts

Example
init(options) {
   super.init(options);
   this.startBehavior(MyTopLevelBehavior);
}