LevelZ File Format
  • 🏠Home
  • Documentation
    • Introduction
    • 📑Headers
    • 📦Blocks
    • 🧭Coordinates
    • Conclusion
  • Usage
    • Bindings
    • CLI
  • Examples
    • 2D Examples
      • 🌾Grasslands
      • 🌋Volcano
    • 3D Examples
      • 🌾Grasslands
Powered by GitBook
On this page
  • Examples
  • Example 1
  • Example 2
  • Example 3
  • Official Headers
  • Custom Headers
  1. Documentation

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:

Declaration
Required
Description
Notes

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

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

Last updated 1 year ago

📑