Skip to content

Statements

General Purpose

with <mode> | mode = tile(tilesheet_name) | mode = animation | mode = tile

The mode and global configuration of the program.

init { ... }

Initialise the environment given some properties and their values.

say(variable | string_literal | expression)

Print a value to the standard output stream.

dump(variable)

Dump a structure to the standard output stream, __all__ can be used to dump all values for debugging purposes.

var $variable_name

Declare a variable.

set_rand_range(min, max)

Set the range for the random number generator.

if ($condition) do [ ... ]

Conditional execution of a block if the condition is true.

else [ ... ]

Optional else block to execute if the previous if condition is false.

loop ($condition) { ... }

Execute the enclosed block repeatedly while the condition is true.

set(x, y, tile)

Set the tile at coordinates (x, y) to the specified tile ID.

get(x, y)

Retrieve the tile value at coordinates (x, y).

return <value>

Return a value from a method or function.

method method_name(params) { ... }

Define a reusable compile-time method.

Tile/PCG specific

gen { ... }

Begin a procedural generation block to iterate over coordinates or ranges.

$i * (start, end) { ... }

Loop iterator over a numeric range, where $i takes values from start to end.

$var * [val1, val2, val3] { ... }

Loop iterator for PCG over a list of discrete values.

in_bounds(x, y)

Check if the coordinates (x, y) are within map boundaries.

rows { ... }

Define rows of tiles sequentially.

xrows { ... }

Define rows that may be mirrored horizontally via the !mirror annotation. Using !mirror with regular rows will mirror them vertically.

Animation specific

<animation_name> { ... }

Define properties of a named animation (e.g., position, size).

-> <animation_step>

Define an animation transition to the next step or effect.