Editor

LittleJS Level Editor

  • Paint the game's tile layers while it is paused, then keep playing with the changes
  • Press 0 while the debug overlay is open to edit, 0 again to play, or call levelEditor.open() and close()
  • Edits the Tiled map the game loaded, saves it back as Tiled JSON, and autosaves every change
  • Debug builds only, the release build has stubs for its names in engineRelease.js and none of its code

Classes

LevelEditor

Members

(static, constant) levelEditor :LevelEditor

The level editor, levelEditor.open() to edit the level, levelEditor.close() to play on with the changes

Type:
  • LevelEditor

Type Definitions

EditorPlayFromCallback(pos)

Parameters:
NameTypeDescription
posVector2

Where to start playing

EditorRestartCallback()

EditorTileCallback(layer, pos, tile)

Parameters:
NameTypeDescription
layerTileLayer

The layer painted

posVector2

The cell's position in the layer

tilenumber | undefined

The tile painted, undefined when erased