Skip to content

Instantly share code, notes, and snippets.

@dario-zubovic
Created December 21, 2018 12:37
Show Gist options
  • Save dario-zubovic/a8413bd8e991cc9438c5377f67aa1527 to your computer and use it in GitHub Desktop.
Save dario-zubovic/a8413bd8e991cc9438c5377f67aa1527 to your computer and use it in GitHub Desktop.
Conway's Game of Sokoban (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Conway's Game of Sokoban
author Jack Kutilek
homepage jackkutilek.itch.io
(verbose_logging)
key_repeat_interval .07
require_player_movement
========
OBJECTS
========
Background
GREEN GREEN
11111
01111
11101
11111
10111
Target
DarkBlue
.....
.000.
.0.0.
.000.
.....
Wall
BROWN
Player
Black Orange White Blue
.000.
.111.
22222
.333.
.3.3.
Crate
Orange Yellow
00000
0...0
0...0
0...0
00000
onCell
blue
offcell
transparent
hasUp
transparent
hasDown
transparent
hasLeft
transparent
hasRight
transparent
hasUpRight
transparent
hasUpLeft
transparent
hasDownRight
transparent
hasDownLeft
transparent
leftSpread
transparent
rightSpread
transparent
counter1
transparent
counter2
transparent
counter3
transparent
counter4
transparent
playerToken
transparent
=======
LEGEND
=======
. = Background
# = Wall
P = Player
* = Crate
@ = Crate and Target
O = Target
C = oncell
has = hasRight or hasup or hasLeft or hasDown or hasDownleft or hasDownRight or hasUpRight or hasUpLeft
spread = leftSpread or rightSpread
counter = counter1 or counter2 or counter3 or counter4
cell = onCell or offcell
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
Target
Player, Wall, Crate, oncell
offcell
counter
playerToken
leftSpread
rightSpread
hasup
hasDown
hasLeft
hasRight
hasUpRight
hasUpLeft
hasDownRight
hasDownLeft
======
RULES
======
[ > Player | Crate ] -> [ > Player | > Crate ]
[player ] -> [player playerToken]
late [player playerToken] -> cancel
late [no oncell no offcell] -> [offcell]
late right [ | oncell | ] -> [leftSpread | oncell | rightSpread]
late down [oncell | cell] -> [oncell | cell hasup]
late down [cell | oncell] -> [cell hasdown | oncell]
late down [leftSpread | cell] -> [leftSpread | cell hasUpRight]
late down [rightSpread | cell] -> [rightSpread | cell hasUpLeft]
late down [cell | leftSpread] -> [cell hasdownright | leftSpread]
late down [cell | rightSpread] -> [cell hasdownleft | rightSpread]
late right [oncell | cell] -> [oncell | cell hasLeft]
late right [cell | oncell] -> [cell hasRight | oncell]
late [cell has no counter] -> [cell counter1]
late [cell has counter1] -> [cell counter2]
late [cell has counter2] -> [cell counter3]
late [cell has counter3] -> [cell counter4]
late [oncell no counter] -> [offcell]
late [oncell counter1] -> [offcell]
late [oncell counter4] -> [offcell]
late [offcell counter3 player] -> [ offcell no player]
late [offcell counter3 crate] -> [ oncell no crate]
late [offcell counter3] -> [oncell]
late [counter] -> []
late [has] -> []
late [spread] -> []
late [playerToken] -> []
==============
WINCONDITIONS
==============
All Target on Crate
=======
LEVELS
=======
message good luck!
###################
#.#...#..##..##..##
#.#...#.#.#.#.#...#
#.#.#.#...#.#.###.#
#.#.#.#.####..#...#
###################
###.............###
##.....p..*......##
#.................#
#.................#
#........c........#
#........c........#
#........c........#
#.................#
#....ccc.o.ccc....#
#.................#
#........c........#
#........c........#
#........c........#
#.................#
#.................#
##...............##
###.............###
###################
#..##.#..##.###...#
#...#.#...#.###..##
###.#.#.#.#.###.###
#...#.#...#...#...#
###################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment