Headers
Each LevelZ File has what are known as "headers." Headers define basic information about the game file, such as its dimension type, scroll information, spawn point, and any other information that is either officially supported or supported by your parsing implementation.
Each header starts with an at symbol (@
), followed by its name and including information separated by a space.
Headers can store any value, and anything passed after the space separation is parsed as an entire string.
Separate headers with a new line, and end the header section with three dashes ---
. This will indicate to the parser that the header section has ended, and now level data should be passed.
Examples
Implementations must require the @type
and @spawn
headers when writing or parsing files.
Example 1
This example defines a 2-dimensional Level Format with a Default Spawnpoint.
The default spawnpoint on 2D is[0, 0]
, with its 3D counterpart being [0, 0, 0]
.
Example 2
This example defines a 3-dimensional Level Format with a Spawnpoint at [1, 2, -3]
.
Example 3
This example defines a 2-dimensional Level Format with a Spawnpoint at [20, 0]
that automatically scrolls horizontally to the left.
Official Headers
The following is an official list of headers that LevelZ Parsers should provide explicit support for:
@type
Declares whether it is a 2D or 3D Level.
@spawn
Declares the player spawnpoint.
@scroll
Declares the auto-scrolling speed. Supports none
, horizontal-left
, horizontal-right
, vertical-up
, and vertical-down
.
Support only provided for 2D Levels.
Custom Headers
LevelZ Parsers do not enforce any kind of specific header names or types, other than the required @type
and @spawn
headers. Thus, you can pass custom file information that is potentially unique to your game.
Last updated