Bird's-eye view of a PuzzleScript file

A puzzlescript file is divided into 8 sections:

Levels

Here's where all the fun happens! A level section of a file looks something like this:

=======
LEVELS
=======

#########
#.......#
#.*.*.O.#
#..*..O.#
#.P.*.*.#
#.......#
#########

MESSAGE Woah, that was tough, eh?!

#########
#.....@.#
#.P.*.O.#
#.......#
#########

#########
#.....@.#
#.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.

Level Select

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

#########
#.....@.#
#.P.*.O.#
#.......#
#########

MESSAGE You beat level 2!

MESSAGE This level cannot be accessed from the level select screen.

#########
#...*.@.#
#.P.*.O.#
#...*.O.#
#########

MESSAGE Thank you for playing the game.

The level ids (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 ids are internal-only, and are never shown to the player. Note that you can forcibly delete progress (e.g. after fixing an unintended solution) by changing a level's id. Player save data is saved separately for each game, based on its title. (with a minimal attempt to recognize titles like "mygame v1.1" and "mygame v1.2" as the same game)

What stuff is hard to do?

Branching. I have no support for it in terms of this level structure. If you want a continuous open world where you don't see everything all the time 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 : )