A puzzlescript file is divided into 8 sections:
Here's where all the fun happens. A level section of a file looks something like this:
#########
#.......#
#.*.*.O.#
#..*..O.#
#.P.*.*.#
#.......#
#########
MESSAGE Woah, that was tough, eh?!
#########
#[email protected]#
#.P.*.O.#
#.......#
#########
#########
#[email protected]#
#.P.*.O.#
#.......#
#########
MESSAGE Thank you for playing the game.
Levels are separated by blank lines, and you can also display messages if you want to. If you want to have several objects occupying single tile, you can specify this in the legend using and:
@ = Crate and Target
If you hold CTRL (or, on a Mac, CMD) and left click on the level in the text editor, it will load it in game.
If you set enable_level_select in the prelude, players will be able to jump to any level from the menu. (Note that this means they can also skip levels freely).
If you want to have more control over where exactly the level select screen takes the player, you can write level_select_point at every point that you want to be able to jump to from the level select screen. For example:
LEVEL_SELECT_POINT intro1
MESSAGE Welcome to level 1
#########
#.......#
#.*.*.O.#
#..*..O.#
#.P.*.*.#
#.......#
#########
MESSAGE You beat level 1!
LEVEL_SELECT_POINT tricky_variant_2
MESSAGE Welcome to level 2
#########
#[email protected]#
#.P.*.O.#
#.......#
#########
MESSAGE You beat level 2!
MESSAGE This level cannot be accessed from the level select screen.
#########
#...*[email protected]#
#.P.*.O.#
#...*.O.#
#########
MESSAGE Thank you for playing the game.
The level names (in this case, "intro1" and "tricky_variant_2") are optional, but will help persist players' save data in the level select menu if you update your game and rearrange the levels. These level names are internal-only, and are never shown to the player.
Branching. I have no support for it in terms of this level structure. If you want a continuous open world you can set zoomscreen or flickscreen in the prelude.
If you can think of an elegant way to implement level branching in the engine, let me know, and I'll consider it : )