Scene class. (World class in other engines)
| Name | Type | Description |
|---|---|---|
game |
Core.Game | the game object |
Members
-
is scene paused
-
physicsEngine Physics.PhysicsEngine
-
scene's physics engine
Methods
-
adds entity
Name Type Description entityCore.Entity the entity to add Returns:
Type Description Boolean true if added, false otherwise. -
createEntity (name, x, y, firstChild)Core.Entity
-
creates entity
Name Type Description nameString entity name xNumber the x position yNumber the y position firstChildobject entity's first child Returns:
Type Description Core.Entity the newly created entity -
createManualEntity (name, x, y, firstChild)Core.Entity
-
creates manual entity (does not render, update automatically etc.)
Name Type Description nameString entity name xNumber the x position yNumber the y position firstChildobject entity's first child Returns:
Type Description Core.Entity the newly created entity -
createNewEntity (firstChild)Core.Entity
-
creates new entity
Name Type Description firstChildobject entity's first child Returns:
Type Description Core.Entity the newly created entity -
deletes an entity from scene
Name Type Description entityNameString The entity's name Returns:
Type Description Boolean True if deleted, false otherwise. -
loads scene from serialized data
Name Type Description dataObject the data -
generates child name
Name Type Description parentCore.Entity parent entity childobject child object/entity Returns:
Type Description String the generated name -
getEntity (name)Core.Entity
-
gets entity by name
Name Type Description nameString entity name Returns:
Type Description Core.Entity entity if found, null otherwise. -
generates entity name
Returns:
Type Description String the generated name. -
the file drop handler
Name Type Description fileString file data -
pause game
-
renders scene
Returns:
Type Description Boolean true if rendered, false otherwise. -
resume scene
-
serialize scene data
Returns:
Type Description Object scene data representation object -
updates scene (advance tick)
Returns:
Type Description Boolean updated