Class: SceneGame

SceneGame

Abstract class for the game stack

new SceneGame (loading)

Name Type Default Description
loading boolean true optional Indicate if the scene should load async stuff
Properties:
Name Type Description
reactionInterpreters Array.<ReactionInterpreter> The reaction interpreters for parallel reactions
parallelCommands Array.<EventCommand> Commands that are still running without blocking any other command
loading boolean Indicate if the scene is loading

Methods

load () async

Load async stuff

updateInterpreters ()

Update all the reactions interpreters

updateParallelCommands ()

Update all the parallel commands

addReaction (sender, reaction, object, state, parameters, event, moving)

Add a reaction in the interpreter list
Name Type Description
sender MapObject The sender of this reaction
reaction SystemReaction The reaction to add
object MapObject The object reacting
state number The state ID
parameters Array.<SystemParameter> All the parameters coming with this reaction
event Array.<number> The time events values
moving boolean Indicate if command is a moving one

update ()

Update the scene

onKeyPressed (key)

Handle scene key pressed
Name Type Description
key number The key ID

onKeyReleased (key)

Handle scene key released
Name Type Description
key number The key ID

onKeyPressedRepeat (key)boolean

Handle scene pressed repeat key
Name Type Description
key number The key ID
Returns:
Type Description
boolean

onKeyPressedAndRepeat (key)boolean

Handle scene pressed and repeat key
Name Type Description
key number The key ID
Returns:
Type Description
boolean

draw3D ()

Draw the 3D scene

drawHUD ()

Draw the HUD scene

close ()

Close the scene