Constructor
new Level2D(headersopt, blocksopt)
Constructs a 2D Level.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
headers |
Map.<string, any> | Object.<string, any> |
<optional> |
The headers of the level |
blocks |
Set.<LevelObject> | Array.<LevelObject> |
<optional> |
The blocks in the level |
Extends
Members
blocks :Set.<LevelObject>
The blocks in the level.
Type:
- Set.<LevelObject>
- Overrides:
- Source:
coordinates
Gets all the coordinates of the blocks in the level.
- Overrides:
- Source:
dimension :Dimension
The dimension of the level.
Type:
- Overrides:
- Source:
headers :Map.<string, any>
The headers of the level.
Type:
- Map.<string, any>
- Overrides:
- Source:
rawBlocks
Gets all the raw blocks in the level.
- Overrides:
- Source:
scroll
Returns the scroll direction of this 2D Level.
scroll
Sets the scroll direction of this 2D Level.
spawn
Gets the spawn point of the level.
- Overrides:
- Source:
spawn
Sets the spawn point for the level.
- Overrides:
- Source:
Methods
toString() → {string}
Gets the string representation of the level.
- Overrides:
- Source:
Returns:
The string representation of the level.
- Type
- string