Bird's-eye view of a PuzzleScript file

A puzzlescript file is divided into 8 sections:

CollisionLayers

Objects can be placed on different layers:

Background
Target
Player, Wall, Crate

The main purpose of layers is in resolving movements: two objects on the same layer cannot coexist in a single cell. The order of layers also determines in what order things are drawn.

The Background layer is a special layer. Every game must have one. Every tile must have a background tile. However, by defining

Background = Background1 or Background2

in the legend, you can have several tile types on the background layer. Every tile must have a background tile. If you don't specify one explicitly for a tile, it is inferred based on what background tiles are on the level it's in.