Class: EventCommand

EventCommand

An event command

new EventCommand ()

Properties:
Name Type Description
isDirectNode boolean Indicate if this node is directly going to the next node (takes only one frame)
parallel boolean Indicate if this command is run in parallel

Methods

EventCommand.getEventCommand ()EventCommand static

Get the event command and read json
Returns:
Type Description
EventCommand

initialize ()Object

Initialize the current state
Returns:
Type Description
Object The current state

update (currentState, object, state)number

Update and check if the event is finished
Name Type Description
currentState Object The current state of the event
object MapObject The current object reacting
state number The state ID
Returns:
Type Description
number The number of node to pass

onKeyPressed (currentState, key)

First key press handle for the current stack
Name Type Description
currentState Object The current state of the event
key number The key ID pressed

onKeyReleased (currentState, key)

First key release handle for the current stack
Name Type Description
currentState Object The current state of the event
key number The key ID pressed

onKeyPressedRepeat (currentState, key)boolean

Key pressed repeat handle for the current stack
Name Type Description
currentState Object The current state of the event
key number The key ID pressed
Returns:
Type Description
boolean

onKeyPressedAndRepeat (currentState, key)

Key pressed repeat handle for the current stack, but with a small wait after the first pressure (generally used for menus)
Name Type Description
currentState Object The current state of the event
key number The key ID pressed

drawHUD (currentState)

Draw the HUD
Name Type Description
currentState Object The current state of the event