Skip to content

Instantly share code, notes, and snippets.

@obriencole11
Last active April 1, 2018 02:21
Show Gist options
  • Save obriencole11/2161d448026a092a16ea39a5e9a9d1d1 to your computer and use it in GitHub Desktop.
Save obriencole11/2161d448026a092a16ea39a5e9a9d1d1 to your computer and use it in GitHub Desktop.
title On The Grid Off The Grid
author Cole O'Brien
homepage www.puzzlescript.net
again_interval 0.1
color_palette proteus_night
require_player_movement
========
OBJECTS
========
Background
Green
Wall
BROWN
Player
Red
.....
.000.
.000.
.000.
.....
BlackCastle 4
Black
0.0.0
00000
00000
00000
00000
BlackPawnUp 0
Black
.....
..0..
.000.
00000
.....
BlackPawnDown 1
Black
.....
00000
.000.
..0..
.....
BlackPawnRight 2
Black
.0...
.00..
.000.
.00..
.0...
BlackPawnLeft 3
Black
...0.
..00.
.000.
..00.
...0.
WhiteCastle e
White
0.0.0
00000
00000
00000
00000
WhitePawnUp a
White
.....
..0..
.000.
00000
.....
WhitePawnDown b
White
.....
00000
.000.
..0..
.....
WhitePawnRight c
White
.0...
.00..
.000.
.00..
.0...
WhitePawnLeft d
White
...0.
..00.
.000.
..00.
...0.
Explosion +
gray
0...0
.0.0.
.....
.0.0.
0...0
Empty
Red
BlackPawnProxy
Black
WhitePawnProxy
White
PlayerTurn
Red
EnemyTurn
Black
BlackObstacle
Black
BlackEnterMarker
Black
BlackMergeMarker
Black
WhiteObstacle
White
WhiteEnterMarker
White
WhiteMergeMarker
White
DestroyMarker
Red
=======
LEGEND
=======
. = Background
# = Wall
P = Player
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
Player, Wall, BlackPawnUp, BlackCastle, BlackPawnDown, BlackPawnRight, BlackPawnLeft, WhitePawnUp, WhiteCastle, WhitePawnDown, WhitePawnRight, WhitePawnLeft
Empty
PlayerTurn
EnemyTurn
BlackObstacle
WhiteObstacle
DestroyMarker
BlackPawnProxy
BlackMergeMarker
BlackEnterMarker
WhitePawnProxy
WhiteMergeMarker
WhiteEnterMarker
Explosion
======
RULES
======
[Explosion] -> []
( ----- SETUP ----- )
(If the player moves, trigger another turn)
[> Player] -> again
( STATES )
[Stationary Player] -> [stationary Player EnemyTurn]
[Moving Player] -> [Moving Player PlayerTurn]
( Mark all pawns with a proxy)
(B)
[ BlackPawnUp] -> [ BlackPawnUp BlackPawnProxy]
[ BlackPawnDown] -> [ BlackPawnDown BlackPawnProxy]
[ BlackPawnLeft] -> [ BlackPawnLeft BlackPawnProxy]
[ BlackPawnRight] -> [ BlackPawnRight BlackPawnProxy]
(W)
[ WhitePawnUp] -> [ WhitePawnUp WhitePawnProxy]
[ WhitePawnDown] -> [ WhitePawnDown WhitePawnProxy]
[ WhitePawnLeft] -> [ WhitePawnLeft WhitePawnProxy]
[ WhitePawnRight] -> [ WhitePawnRight WhitePawnProxy]
( Mark Obstacles )
[ Wall ] -> [ Wall BlackObstacle WhiteObstacle ]
[ Player ] -> [ Player BlackObstacle WhiteObstacle ]
[ BlackPawnProxy ] -> [ BlackPawnProxy BlackObstacle ]
[ BlackCastle ] -> [ BlackCastle BlackObstacle ]
[ WhitePawnProxy ] -> [ WhitePawnProxy WhiteObstacle ]
[ WhiteCastle ] -> [ WhiteCastle WhiteObstacle ]
( Mark Empty Square )
[ No Player No BlackCastle No WhiteCastle No Wall No BlackPawnProxy No WhitePawnProxy No Wall] -> [Empty]
( ----- Player Turn ----- )
( Player can push Pawns )
[ > Player | BlackPawnProxy ] -> [ > Player | > BlackPawnProxy ]
[ > Player | WhitePawnProxy ] -> [ > Player | > WhitePawnProxy ]
( Player can push Castles )
[ > Player | BlackCastle ] -> [ > Player | > BlackCastle ]
[ > Player | WhiteCastle ] -> [ > Player | > WhiteCastle ]
[ > BlackCastle | WhiteCastle ] -> [|Explosion]
[ > WhiteCastle | BlackCastle ] -> [|Explosion]
[ > BlackCastle | WhitePawnProxy ] -> [ > BlackCastle | Explosion]
[ > WhiteCastle | BlackPawnProxy ] -> [ > WhiteCastle | Explosion]
[ > BlackPawnProxy | WhitePawnProxy ][PlayerTurn] -> [|Explosion][PlayerTurn]
[ > WhitePawnProxy | BlackPawnProxy ][PlayerTurn] -> [|Explosion][PlayerTurn]
[ > BlackPawnProxy | BlackPawnProxy ][PlayerTurn] -> [ | BlackMergeMarker ][PlayerTurn]
[ > WhitePawnProxy | WhitePawnProxy ][PlayerTurn] -> [ | WhiteMergeMarker ][PlayerTurn]
( ----- Enemy Turn ----- )
(B)
[ BlackPawnUp stationary BlackPawnProxy ][ EnemyTurn ] -> [ BlackPawnUp > BlackPawnProxy ][ EnemyTurn ]
[ BlackPawnDown stationary BlackPawnProxy ][ EnemyTurn ] -> [ BlackPawnDown < BlackPawnProxy ][ EnemyTurn ]
[ BlackPawnLeft stationary BlackPawnProxy ][ EnemyTurn ] -> [ BlackPawnLeft ^ BlackPawnProxy ][ EnemyTurn ]
[ BlackPawnRight stationary BlackPawnProxy ][ EnemyTurn ] -> [ BlackPawnRight v BlackPawnProxy ][ EnemyTurn ]
(W)
[ WhitePawnUp stationary WhitePawnProxy ][ EnemyTurn ] -> [ WhitePawnUp > WhitePawnProxy ][ EnemyTurn ]
[ WhitePawnDown stationary WhitePawnProxy ][ EnemyTurn ] -> [ WhitePawnDown < WhitePawnProxy ][ EnemyTurn ]
[ WhitePawnLeft stationary WhitePawnProxy ][ EnemyTurn ] -> [ WhitePawnLeft ^ WhitePawnProxy ][ EnemyTurn ]
[ WhitePawnRight stationary WhitePawnProxy ][ EnemyTurn ] -> [ WhitePawnRight v WhitePawnProxy ][ EnemyTurn ]
(B)
[ BlackPawnUp > BlackPawnProxy | BlackObstacle ][ EnemyTurn ] -> [ BlackPawnDown < BlackPawnProxy | BlackObstacle ][ EnemyTurn ]
[ BlackPawnDown > BlackPawnProxy | BlackObstacle ][ EnemyTurn ] -> [ BlackPawnUp < BlackPawnProxy | BlackObstacle ][ EnemyTurn ]
[ BlackPawnLeft > BlackPawnProxy | BlackObstacle ][ EnemyTurn ] -> [ BlackPawnRight < BlackPawnProxy | BlackObstacle ][ EnemyTurn ]
[ BlackPawnRight > BlackPawnProxy | BlackObstacle ][ EnemyTurn ] -> [ BlackPawnLeft < BlackPawnProxy | BlackObstacle ][ EnemyTurn ]
(W)
[ WhitePawnUp > WhitePawnProxy | WhiteObstacle ][ EnemyTurn ] -> [ WhitePawnDown < WhitePawnProxy | WhiteObstacle ][ EnemyTurn ]
[ WhitePawnDown > WhitePawnProxy | WhiteObstacle ][ EnemyTurn ] -> [ WhitePawnUp < WhitePawnProxy | WhiteObstacle ][ EnemyTurn ]
[ WhitePawnLeft > WhitePawnProxy | WhiteObstacle ][ EnemyTurn ] -> [ WhitePawnRight < WhitePawnProxy | WhiteObstacle ][ EnemyTurn ]
[ WhitePawnRight > WhitePawnProxy | WhiteObstacle ][ EnemyTurn ] -> [ WhitePawnLeft < WhitePawnProxy | WhiteObstacle ][ EnemyTurn ]
[ > BlackPawnProxy | WhiteCastle ] -> [ | Explosion WhiteCastle]
[ > WhitePawnProxy | BlackCastle ] -> [ | Explosion BlackCastle]
[ > BlackPawnProxy | < WhitePawnProxy ] -> [|Explosion]
[ > WhitePawnProxy | < BlackPawnProxy ] -> [|Explosion]
[ > BlackPawnProxy | stationary WhitePawnProxy ] -> [|Explosion]
[ > WhitePawnProxy | stationary BlackPawnProxy ] -> [|Explosion]
( ----- Cleanup ----- )
( Place enter markers in front of pawns )
(B)
[ > BlackPawnProxy | No BlackEnterMarker No BlackObstacle] -> [ > BlackPawnProxy | > BlackEnterMarker ]
[ > BlackPawnProxy | < BlackEnterMarker ] -> [ > BlackPawnProxy | BlackMergeMarker ]
[ > BlackPawnProxy | ^ BlackEnterMarker ] -> [ > BlackPawnProxy | BlackMergeMarker ]
[ > BlackPawnProxy | v BlackEnterMarker ] -> [ > BlackPawnProxy | BlackMergeMarker ]
(W)
[ > WhitePawnProxy | No WhiteEnterMarker No WhiteObstacle ] -> [ > WhitePawnProxy | > WhiteEnterMarker ]
[ > WhitePawnProxy | < WhiteEnterMarker ] -> [ > WhitePawnProxy | < WhiteEnterMarker WhiteMergeMarker ]
[ > WhitePawnProxy | ^ WhiteEnterMarker ] -> [ > WhitePawnProxy | ^ WhiteEnterMarker WhiteMergeMarker ]
[ > WhitePawnProxy | v WhiteEnterMarker ] -> [ > WhitePawnProxy | v WhiteEnterMarker WhiteMergeMarker ]
[ BlackEnterMarker WhiteEnterMarker ] -> [ DestroyMarker ]
[ WhiteEnterMarker BlackEnterMarker ] -> [ DestroyMarker ]
[ DestroyMarker WhiteMergeMarker ] -> [ DestroyMarker ]
[ DestroyMarker BlackMergeMarker ] -> [ DestroyMarker ]
[ > BlackPawnProxy | DestroyMarker ] -> [ | DestroyMarker ]
[ > BlackPawnProxy DestroyMarker ] -> [ DestroyMarker ]
[ > WhitePawnProxy | DestroyMarker ] -> [ | DestroyMarker ]
[ > WhitePawnProxy DestroyMarker ] -> [ DestroyMarker ]
( Convert Proxy Movement to Pawn Movement )
(B)
[ > BlackPawnProxy BlackPawnUp ] -> [ > BlackPawnProxy > BlackPawnUp ]
[ > BlackPawnProxy BlackPawnDown ] -> [ > BlackPawnProxy > BlackPawnDown ]
[ > BlackPawnProxy BlackPawnLeft ] -> [ > BlackPawnProxy > BlackPawnLeft ]
[ > BlackPawnProxy BlackPawnRight ] -> [ > BlackPawnProxy > BlackPawnRight ]
(W)
[ > WhitePawnProxy WhitePawnUp ] -> [ > WhitePawnProxy > WhitePawnUp ]
[ > WhitePawnProxy WhitePawnDown ] -> [ > WhitePawnProxy > WhitePawnDown ]
[ > WhitePawnProxy WhitePawnLeft ] -> [ > WhitePawnProxy > WhitePawnLeft ]
[ > WhitePawnProxy WhitePawnRight ] -> [ > WhitePawnProxy > WhitePawnRight ]
( Remove Pawns inside or moving towards a Merge Marker )
[ > BlackPawnProxy | BlackMergeMarker ] -> [ | BlackMergeMarker ]
[ BlackPawnProxy BlackMergeMarker ] -> [ BlackMergeMarker ]
[ > WhitePawnProxy | WhiteMergeMarker ] -> [ | WhiteMergeMarker ]
[ WhitePawnProxy WhiteMergeMarker ] -> [ WhiteMergeMarker ]
( Replace MergeMarkers with Castles )
[ BlackMergeMarker ] -> [ BlackCastle ]
[ WhiteMergeMarker ] -> [ WhiteCastle ]
( Missing Proxies idicates that the Black Pawn has been removed )
(B)
[ BlackPawnUp No BlackPawnProxy ] -> []
[ BlackPawnDown No BlackPawnProxy ] -> []
[ BlackPawnLeft No BlackPawnProxy ] -> []
[ BlackPawnRight No BlackPawnProxy ] -> []
(W)
[ WhitePawnUp No WhitePawnProxy ] -> []
[ WhitePawnDown No WhitePawnProxy ] -> []
[ WhitePawnLeft No WhitePawnProxy ] -> []
[ WhitePawnRight No WhitePawnProxy ] -> []
( Remove Proxies and Markers )
[BlackEnterMarker] -> []
[BlackMergeMarker] -> []
[WhiteEnterMarker] -> []
[WhiteMergeMarker] -> []
[Empty] -> []
[BlackPawnProxy] -> []
[WhitePawnProxy] -> []
[PlayerTurn] -> []
[EnemyTurn] -> []
[BlackObstacle] -> []
[WhiteObstacle] -> []
[DestroyMarker] -> [Explosion]
==============
WINCONDITIONS
==============
No BlackPawnDown
No BlackPawnUp
No BlackPawnRight
No BlackPawnLeft
No BlackCastle
No WhitePawnDown
No WhitePawnUp
No WhitePawnRight
No WhitePawnLeft
No WhiteCastle
=======
LEVELS
=======
#########
#########
#.P.4..e#
#########
#########
#########
#########
#########
##e....##
##P.e4.##
##4....##
#########
#########
#########
#########
#..1..1.#
#P......#
#...a..a#
#########
#########
#########
#########
##....b##
##P.e4.##
##.....##
#########
#########
#########
#########
##...1e##
##P....##
##..0..##
#########
#########
########
##.bb.##
##4...##
##P...##
##.aa.##
########
#########
##.....##
##....d##
##2P..d##
##2...d##
##.....##
#########
#########
##....d##
##..e..##
##.4#####
##..#####
##aP#####
#########
###########
#..3..2...#
#e#4#e#4#e#
#.........#
#....p....#
###########
#########
##.0.b.##
##.#.#.##
##.0pb.##
##.#.#.##
##.0.b.##
#########
##########
##########
##########
##.c..d.e#
#P.c..d..#
#..2..3..#
##.2..3.4#
##########
##########
##########
#########
#.1...#.#
#.#...b.#
#.0...e.#
#.#..pa.#
#.0...#.#
#########
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment