zerk.game.engine.world Class
World
This class represents the world.
All world classes should inherit from here.
Item Index
Properties
Methods
_log
(
protected
-
msg
Local log method
Parameters:
-
msg
StringLog message
_setup
()
protected
Defines the initial world state
_spawn
(
protected
-
entity
-
config
Creates a new entity instance with given configuration
Parameters:
-
entity
zerk.game.engine.entity -
config
ObjectEntity configuration
clear
()
Removes all entities from the world
destroy
(
Boolean
-
entity
Removes given entity from the world
Parameters:
-
entity
zerk.game.engine.entity
Returns:
Boolean:
Returns true on success
getEntityById
(
Null | zerk.game.engine.entity
-
id
Returns entity instance by given id
Parameters:
-
id
StringEntity id
Returns:
Null | zerk.game.engine.entity:
Entity or null
Properties
_config
Object
protected
World configuration
_mapEntity
Object
protected
Entity id to instance map
entities
Array
Entities array