home ps help

Hat-tricks

Think wand-like and try to escape a box of magical hats, but where exactly is the escape hat(ch)?

If you are unfamiliar with puzzlescript games then be prepared for a lack of instruction. The goal and underlying mechanic are not always stated, they need to be discovered. In this instance however the unknowns should reveal themselves pretty quickly. Just go explore...

Development notes

This puzzle concept was conceived in July 2022 after discovering the theme of Thinky Puzzle Game Jam No.2. It became very clear, very quickly, that I was never going to hit the submission dead-line but I liked the idea too much to abandon it. In the end it turned into an all-consuming project, thanks to a decision to implement it in an unfamiliar fork of puzzlescript called Pattern:Script (P:S) maintained by Clement Sparrow.

P:S was chosen in this instance because I realised it would vastly reduce the overall code size. To illustrate just one aspect of the reduction, the 30 lines of code on the right suffices for defining 16 different 9x9 graphical sprites (one for each of the four decorated hats in each of its four possible orientations). And thus 300+ lines of sprite definitions collapsed down to 30 lines. To explore the full source click here.

So yes, this is sokoban... of sorts. Each pushable object (hat) has one open side that acts as a portal linked to another hat. The pusher is now a two-unit object which has two distinct states, horizontal and vertical. Passing through the portal (pointy end first) is referred to as a hat-trick and hat-tricks are the only way to facilitate a change of orientation. Thus, the state-space you can reach at any point in time depends on your current orientation, the pushable objects around you and the accessible open hats. Several interesting interactions can occur if you enter a hat where the exit path is partially blocked.

Links & related pages


concept & puzzle set - © Andrea Gilbert 2022
pattern:script implementation - © Andrea Gilbert - 2022
pattern:script fork - maintained by Clement Sparrow