API Docs for: 0.1.0
Show:

zerk.game.engine.worldLoader Class

World Loader

Loads world definitions from JSON files.

Methods

_loadEntities

(
  • world
  • entities
  • successHandler
  • errorHandler
)
protected async

Loads given entities

Parameters:

  • world Object

    World definition

  • entities Array

    Array of entities

  • successHandler Function

    Event handler for success

  • errorHandler Function

    Event handler for error

_onLoadEntities

(
  • world
  • entities
  • successHandler
  • errorHandler
)
protected

Fires when the entities are loaded

Parameters:

  • world Object

    World definition

  • entities Array

    Array of entities

  • successHandler Function

    Event handler for success

  • errorHandler Function

    Event handler for error

_onLoadWorld

(
  • world
  • successHandler
  • errorHandler
)
protected async

Fires when the world is loaded

Parameters:

  • world Object

    World definition

  • successHandler Function

    Event handler for success

  • errorHandler Function

    Event handler for error

init

(
  • engine
)

Class constructor

Parameters:

loadWorld

(
  • name
  • successHandler
  • errorHandler
)
async

Loads a world by given resource id

Parameters:

  • name String

    World resource id

  • successHandler Function

    Event handler for success

  • errorHandler Function

    Event handler for error

Properties

_componentLoader

zerk.game.engine.componentLoader protected

Component loader instance

_entityLoader

zerk.game.engine.entityLoader protected

Entity loader instance

_jsonLoader

zerk.jsonLoader protected

JSON loader instance