Sections of a PuzzleScript file

A puzzlescript file is divided into the following sections.

Legend

This section does a few things. Firstly, it's a place where you can set up single-character names for things so that you can type them in levels. You can use almost any Unicode character, so there are lots to choose from. Best to avoid using special characters such as [ | ] < > ^ v to avoid confusing the parser.

LEGEND
======

P = Player
. = Background
# = Wall
* = Crate
O = Target
⌘ = Box
£ = Pound
⁂ = Stars

Secondly it lets you define aggregate objects using and, where several objects (in different layers) can be placed in a grid tile at the same time.

@ = Crate and Target
deadpile = deadplayer and ash and Target

[ player target fire ] -> [ deadpile ]

And finally, it lets you define property objects using or, that you can refer to in rules and elsewhere.

Flying = Bat or Bird
Obstacle = Wall or Lava or Water

[ > player | obstacle ] -> [ player | obstacle ]  (moving stops here)

Note: legend lines may be expanded if they use names with tag parts. See tags and mappings.