🧭Coordinates

Coordinates are the counterpart to Blocks: they are used to specify where they should go. Coordinates by themselves are very easy to understand, and also provide complex mathematical tools for easier development.

A basic coordinate can be declared using an array-like syntax ([]), with specified coordinates in integer or decimal format:

grass: [0, 0]
stone: [0.5, 1.5]

To combine coordinates in one line, you can use the join keyword (*):

stone: [0, 1, 0]*[0, 2.5, -2]

Coordinates must be in [X, Y] format for a 2D Level, or a [X, Y, Z] format for a 3D Level. This is determined by the @type header described in Headers.

Matrices

Coordinates can also utilize what is known as a coordinate matrix. In simple terms, it creates a rectangle that is bounded by a center coordinate.

grass: (0, 3, 0, 3)^[0, 0]

This line uses the binding keyword (^) to bind the matrix (0, 3, 0, 3) to the center point of [0, 0]. What this does is construct points from [0, 0] to [3, 3] since the matrix starts at 0 and goes to 3 in both X and Y directions. This then is added to the center coordinate, simplifying to a list of coordinates in that area.

You can join matrices together with other points or other matrices using the join keyword described earlier:

magma: (-3, 3, 0, 0)^[1, 1]*(0, 0, 2, 7)^[-2.5, 2.5]*[0, 11]

Matrices are also supported in a 3D Format:

stone: (0, 10, 0, 0, 0, 10)^[0, 5, 0]

Although points support decimal format, as of now, matrices only support integers.

Examples

Example 1

---
stone: [0, 0]*[1, 0]
grass: [0, 1]*[1, 1]

This 2D example declares stone to be placed under grass.

Example 2

---
{stone,stone<cracked=true>}: [0, -1, 0]*[0, -2, 0]*[0, -3, 0]

This 3D example declares a line of both basic and cracked stone.

Example 3

---
grass: (-10, 10, 0, 0)^[0, 0]*(-5, 5, 0, 0)^[0, 1]
stone: (-10, 10, 0, 0)^[0, -1)

This 2D example declares a smaller set of grass, on top of a large set of grass, under a large set of stone.

Last updated