📑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.

@name value

Headers can store any value, and anything passed after the space separation is parsed as an entire string.

@someheader my-value
@someotherheader my-value with-additions
---

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

@type 2
@spawn default
---

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

@type 3
@spawn [1, 2, -3]
---

This example defines a 3-dimensional Level Format with a Spawnpoint at [1, 2, -3].

Example 3

@type 2
@spawn [20, 0]
@scroll horizontal-left
---

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:

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.

@type 2
@spawn default
@scroll none
@difficulty demon
---

Last updated