UNPKG

puzzlescript

Version:

Play PuzzleScript games in your terminal!

236 lines (182 loc) 4.53 kB
(version 1.0) title Bal Ru's Curse cruelty-free demake author Creative Windows [cloned by CHz] homepage quiteajolt.com run_rules_on_level_start ======== OBJECTS ======== Background Blue Block1 Black ..0.. .000. .000. .000. ..0.. Block2 White ..0.. .000. .000. .000. ..0.. Block3 Black ..... .000. 00000 .000. ..... Block4 White ..... .000. 00000 .000. ..... Cursor Orange 00.00 0...0 ..... 0...0 00.00 LeftArrow Orange ...0. ..00. .000. ..00. ...0. UpArrow Orange ..... ..0.. .000. 00000 ..... RightArrow Orange .0... .00.. .000. .00.. .0... DownArrow Orange ..... 00000 .000. ..0.. ..... BlockStart Transparent BlockStorage Transparent WinToken Transparent ======= LEGEND ======= . = Background # = BlockStart 1 = Block1 2 = Block2 3 = Block3 4 = Block4 VertBlock = Block1 or Block2 HorizBlock = Block3 or Block4 Block = VertBlock or HorizBlock @ = BlockStart and Cursor Player = Cursor Arrow = LeftArrow or UpArrow or RightArrow or DownArrow - = BlockStorage ======= SOUNDS ======= EndLevel 39733503 sfx0 13540905 (swap) ================ COLLISIONLAYERS ================ Background BlockStorage WinToken BlockStart Block Arrow Cursor ====== RULES ====== (================ LEVEL GENERATION ================) (Randomly place 4 of each block. I could make this nicer and generalize it to different grid sizes with a loop but nah.) random [BlockStart] -> [Block1] random [BlockStart] -> [Block1] random [BlockStart] -> [Block1] random [BlockStart] -> [Block1] random [BlockStart] -> [Block2] random [BlockStart] -> [Block2] random [BlockStart] -> [Block2] random [BlockStart] -> [Block2] random [BlockStart] -> [Block3] random [BlockStart] -> [Block3] random [BlockStart] -> [Block3] random [BlockStart] -> [Block3] random [BlockStart] -> [Block4] random [BlockStart] -> [Block4] random [BlockStart] -> [Block4] random [BlockStart] -> [Block4] (=============== PLAYER MOVEMENT ===============) (If the player has arrows up but moves in a different direction, clear the arrows.) [Arrow] [> Player | no Arrow] -> [] [> Player | no Arrow] (Cancel movement if the player tries to move outside of the grid.) [> Cursor | no Block] -> [Cursor | no Block] (If the player moves in the direction of an arrow, swap the blocks and clear the arrows.) [Arrow | > Cursor | Arrow] -> [ | > Cursor | Arrow] [> Cursor Block | Arrow] [BlockStorage] -> [> Cursor | Arrow] [BlockStorage Block] [> Cursor | Arrow Block] -> [> Cursor Block | Arrow] [> Cursor | Arrow] [BlockStorage Block] -> [> Cursor | Arrow Block] [BlockStorage] [> Cursor | Arrow] -> [ | Cursor] sfx0 (switch this rule with the one below it to keep the cursor active after the block moves) ([> Cursor | Arrow] -> [ | Action Cursor] sfx0) (============== PLAYER ACTIONS ==============) (If the player doesn't have arrows up and hits action, then pop up the appropriate arrows.) UP [no Arrow | Action Player VertBlock | no Arrow] -> [DownArrow | Player VertBlock | UpArrow] [Arrow no Block] -> [] RIGHT [no Arrow | Action Player HorizBlock | no Arrow] -> [LeftArrow | Player HorizBlock | RightArrow] [Arrow no Block] -> [] (If the player does have arrows up and hits action, then clear the arrows.) [Action Player] [Arrow] -> [Action Player] [] (============ WIN CHECKING ============) (Check that all four rows in the grid match the block to the left of them. If so, this will leave one WinToken on the playing field to match the win condition.) [Block1 | | Block1 | Block1 | Block1 | Block1] -> [Block1 | WinToken | Block1 | Block1 | Block1 | Block1] [Block2 | | Block2 | Block2 | Block2 | Block2] -> [Block2 | WinToken | Block2 | Block2 | Block2 | Block2] [Block3 | | Block3 | Block3 | Block3 | Block3] -> [Block3 | WinToken | Block3 | Block3 | Block3 | Block3] [Block4 | | Block4 | Block4 | Block4 | Block4] -> [Block4 | WinToken | Block4 | Block4 | Block4 | Block4] DOWN [WinToken | WinToken | WinToken | WinToken | ] -> [WinToken | WinToken | WinToken | WinToken | WinToken] [WinToken | Block] -> [ | Block] ============== WINCONDITIONS ============== Some WinToken ======= LEVELS ======= message Sort the blocks so each row of the grid only contains the type of block to its left. message Move the cursor with the arrow keys and press X to select a block. Swap that block with one next to it using the arrow keys or hit X to cancel. message Long blocks can only move horizontally, and tall blocks can only move vertically. message Press R to reset with a new puzzle. -....... .1.@###. .3.####. .2.####. .4.####. ........