A puzzlescript file is divided into the following sections.
OBJECTS
=======
Player P
Blue
If you do this, the player will be a blue square.
You can specify a sprite as a 5x5 grid as follows:
Player P
PINK YELLOW #000000
.222.
.000.
22122
.222.
.2.2.
Which gives you this wee fella:
The first line is the name of the object, and aliases too if you like. So the extra P on the line is another name for the Player object (and you can have as many aliases as you like). This is convenient for creating single characters needed for putting objects into a level, but you can get the same result in the Legend section if you prefer.
The second line is a list of colors. The available color names are as follows, but the exact shade of color is set according to the palette setting in the prelude.
- black
- white
- lightgray/grey
- gray/grey
- darkgray/grey
- red
- darkred
- lightred
- brown
- darkbrown
- lightbrown
- orange
- yellow
- green
- darkgreen
- lightgreen
- blue
- lightblue
- darkblue
- purple
- pink
- transparent
See this Color Chart for a display of the colors in the default palette. You can change the palette if you like.
Or you can use hex codes if you prefer.
The third and following lines are rows of numeric digits making up the sprite grid (or they can be omitted, and then you just get a square). The dots represent transparency, and the numbers 0..9 index the colors in the second line, for as many colors as there are.
In the simple case each line is sprite_size in length and there are sprite_size of them. This defaults to 5x5, but you can set it set to a different value in the prelude.
The sprite grid can be smaller or larger, and does not have to be square. It will be rendered with the bottom left-hand corner aligned with the tile. If it is larger, it will overflow and hide tiles above and to the right. You can use control this, see CollisionLayers.
Following the sprite grid are one or more lines of object transforms. The transforms are executed in order, left to right, and modify the sprite grid as they do so. These are the things you can do.
The shorthands - and | do the same, horizontal and vertical.
In each case of an absolute direction you can use the relative directions > < ^ v instead. This becomes important when used in conjunction with tags.
Instead of a sprite matrix, you can create an object that displays as a string of text. You can see it working in 333. Use it like this.
s; purple; text: S
t; orange; text: tea for two
3; pink; text: 3
4; pink; text: 4
number8 scale: 0.5; green; text: 8
These are the things you can do.