PuzzleScript: the free puzzle-building tool that lets you make games in minutes
"Worst fruit/vegetable thrusting game I have EVER played." The Guardian's games critic Keith Stuart thus appraised the first game I ever made. It was built using PuzzleScript - Stephen Lavelle's puzzle game creation tool - and goes by the name of Avocado Pusher. You use a giant finger to push little avocados into swimming pools. "Typical Guardian," I shot back. "I bet if it had been 'Fancy Artisanal Loaf Pusher' you'd be all over that."
Everyone else had been far more impressed. Ex-PC Gamer critic and current indie dev chap Tom Francis gave it a probably-not-entirely-sarcastic 9/10 and illustrator and games critic Marsh Davies called it "The best 5x5 pixel rendering of an avocado I've seen in a game". One of the creators of endless runner Boson X, Ian MacLarty, even created a mod for the thing called Asparagus Pusher.
I'm saying this not just to point out that Keith was wrong, but to stress how easily you can use PuzzleScript to give you a working game. In the 20 minutes of time I had before I needed to head to the pub I worked out what the most basic commands in the game engine would achieve and created my own items and avatar by fiddling with the colours and pixel patterns in a pre-existing level editor. The end result was insanely straightforward but, crucially, worked as a puzzle game.
Exploring further - after all, Avocado Pusher 2: Electric Boogaloo is not going to make itself - means learning more about the game commands and how those might be used. When someone publishes a game on PuzzleScript's servers players are also offered the option to hack it. Hacking it shows you the script the creator used. It's handy either for rooting around under the bonnet of the game to see what's going on or for allowing you to tinker with or modify it.
The anatomy of the PuzzleScript script is as follows:
First is the housekeeping - your name, the game's title and a homepage URL.
Next are the objects. With a basic game these will probably be "background", "target", "wall", "player" and "crate". You give each of the these a colour attribute if you want a block colour or you can number the different colours and create 5x5 pixel objects. My "crate" was the avocado and in PuzzleScript it looks like this:
Green Lightgreen darkgreen
Once you've set up how your objects will look you create a legend where you ascribe each of the objects a symbol. It's these symbols which you will then use to build levels later on.
Sounds come next although I tended to leave that section blank as there was a very particular squelching sound I wanted and couldn't find.
After sound, collision layers need to be set. Objects are written out in comma separated lists. Any objects on the same line will treat each other as solid. Usually you would want the first layer to be the background, the second layer is for the target and the third is for pretty much everything else. The third layer for Avocado Pusher is "Player, Wall, Crate" which means that the player cannot walk through walls and treats the crates (avocados) as solid objects to be interacted with.
Once that's dealt with you have the rules. This is the part which actually makes the game work. If you're after something super simple you can go for:
[ > Player | Crate ] -> [ > Player | > Crate ]
What this means is when a player pushes a crate the crate will move in the same direction as the player is pushing.
I actually created a second game called Giant Needs a Heart where you have to give a heart to a giant and thus turn him into a human. It is based on a fairytale I half remember where a giant takes out his own heart and then starts kidnapping people. A prince saves everyone somehow because the patriarchy might as well make itself useful and in one version of the story the giant has to put his heart back in and go back to being a good person.
In PuzzleScript that looks like this:
[ > Player | Crate ] -> [ > Player | > Crate ]
[Giant | ... | Player] -> [ > Giant | ... | Player]
late [Crate | Giant ] -> [ | Player]
late [Player | Giant ] -> [ | Giant]
The first line means the player can push the heart around the screen. The second means that when the giant can see the player the giant will move towards the player. The third line means that when the giant and the heart are next to one another the game removes the heart and swaps the giant's avatar for a player avatar. The fourth one means that if the player is next to the giant the player disappears.
After the rules are set you need to fix the win conditions. For Avocado Pusher I had "All Target on Crate" which means that all the avocados had to be in a swimming pool. For Giant Needs a Heart the win condition was "No Crate" which means that the heart had been given to the giant successfully and he was now a human.
When all of that is in place you just use the symbols from the legend you created earlier to design as many levels as you fancy with various layouts and objects. You can save your progress to your computer as you go or roadtest tweaks in a pane on the browser window.
The games I made were simple and mainly built to test whether I'd understood the way the engine works. Other people have really gone to town with Puzzlescript, though. Aaron Steed's Flying Kick is a beautifully crafted jumping and kicking puzzler while Jonah Ostroff has de-made the chemistry puzzler Sokobond using the tool.
If you have a half hour spare I'd recommend poking around in PuzzleScript. It's not suitable for every game idea but as you fiddle with the systems you'll likely find yourself generating new ways to use them as well as uncovering previously unknown talents for pixel avocado artwork. PuzzleScript is a really well designed tool for creating puzzle games as well as testing out concepts quickly. Made something fun? Share it in the comments below.