Members
(constant) Dimension
Represents a Dimension.
- Source:
(constant) Scroll
Represents the scroll direction of a 2D Level.
Methods
parseLevel(level) → {Level}
Parses a LevelZ Level.
Parameters:
Name | Type | Description |
---|---|---|
level |
string | The level input. |
Throws:
-
if the level is invalid
- Type
- SyntaxError
Returns:
The parsed level.
- Type
- Level
Example
// Read from file
import * as fs from 'fs'
fs.readFile('level.lvlz', 'utf8', (err, data) => {
if (err) throw err
const level = parseLevel(data)
console.log(level)
})
Type Definitions
Dimension
2D or 3D space.
Type:
- 2 | 3
- Source:
Scroll
The auto-scroll type in a 2D Level.
Type:
- 'none' | 'horizontal-left' | 'horizontal-right' | 'vertical-up' | 'vertical-down'