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 entity
Core.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 name
String entity name x
Number the x position y
Number the y position firstChild
object 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 name
String entity name x
Number the x position y
Number the y position firstChild
object entity's first child Returns:
Type Description Core.Entity the newly created entity -
createNewEntity (firstChild)Core.Entity
-
creates new entity
Name Type Description firstChild
object entity's first child Returns:
Type Description Core.Entity the newly created entity -
deletes an entity from scene
Name Type Description entityName
String The entity's name Returns:
Type Description Boolean True if deleted, false otherwise. -
loads scene from serialized data
Name Type Description data
Object the data -
generates child name
Name Type Description parent
Core.Entity parent entity child
object child object/entity Returns:
Type Description String the generated name -
getEntity (name)Core.Entity
-
gets entity by name
Name Type Description name
String 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 file
String 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