Class: EventCommandMoveObject

EventCommandMoveObject

An event command for moving object

new EventCommandMoveObject (command)

Name Type Description
command Object Direct JSON command to parse
Properties:
Name Type Description
objectID SystemValue The ID of the object
isIgnore boolean Ignore a move if impossible
isWaitEnd boolean Wait then of all the moves to end the command (parallel command)
isCameraOrientation boolean Take the orientation of the came in count
moves Array.<function()> All the moves callbacks
parameters Array.<Object> Parameters for ach moves callbacks

Extends

Methods

EventCommandMoveObject.oppositeOrientation (orientation)Orientation static

Get the opposite orientation
Name Type Description
orientation Orientation The orientation
Returns:
Type Description
Orientation The current state

initialize ()Object overrides

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

move (currentState, object, square, orientation)

Function to move north
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
square bool Indicate if it is a square move
orientation Orientation The orientation where to move

moveFrequency (object)

Change the frequency tick of the object
Name Type Description
object MapObject The object to move

moveNorth (currentState, object, parameters)

Function to move north
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveSouth (currentState, object, parameters)

Function to move south
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveWest (currentState, object, parameters)

Function to move west
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveEast (currentState, object, parameters)

Function to move east
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveNorthWest (currentState, object, parameters)

Function to move north west
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveNorthEast (currentState, object, parameters)

Function to move north west
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveSouthWest (currentState, object, parameters)

Function to move north west
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveSouthEast (currentState, object, parameters)

Function to move north west
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveRandom (currentState, object, parameters)

Function to move random
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveHero (currentState, object, parameters)

Function to move hero
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveOppositeHero (currentState, object, parameters)

Function to move opposite to hero
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveHeroAndOpposite (currentState, object, parameters, opposite)

Function to move hero and opposite hero
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters
opposite boolean Indicate if opposite

moveFront (currentState, object, parameters)

Function to move front
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

moveBack (currentState, object, parameters)

Function to move back
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

changeGraphics (currentState, object, parameters)

Function to change graphics
Name Type Description
currentState Object The current state of the event
object MapObject The object to move
parameters Object The parameters

getHeroOrientation (object)Orientation

Get the hero orientation
Name Type Description
object MapObject The object to move
Returns:
Type Description
Orientation

update (currentState, object, state)number overrides

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

getCurrentOrientation (currentState)Orientation

Get the current orientation
Name Type Description
currentState Object The current state of the event
Returns:
Type Description
Orientation

onKeyPressed (currentState, key) inherited overrides

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) inherited overrides

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 inherited overrides

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) inherited overrides

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) inherited overrides

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