API Docs for: 0.1.0
Show:

zerk.game.engine.world Class

World

This class represents the world.

All world classes should inherit from here.

Methods

_log

(
  • msg
)
protected

Local log method

Parameters:

  • msg String

    Log message

_setup

() protected

Defines the initial world state

_spawn

(
  • entity
  • config
)
protected

Creates a new entity instance with given configuration

Parameters:

clear

()

Removes all entities from the world

destroy

(
  • entity
)
Boolean

Removes given entity from the world

Parameters:

Returns:

Boolean: Returns true on success

getEntityById

(
  • id
)
Null | zerk.game.engine.entity

Returns entity instance by given id

Parameters:

  • id String

    Entity id

Returns:

Null | zerk.game.engine.entity: Entity or null

init

(
  • engine
)

Class constructor

Parameters:

Properties

_config

Object protected

World configuration

_mapEntity

Object protected

Entity id to instance map

entities

Array

Entities array