Skip to content

Instantly share code, notes, and snippets.

Created June 21, 2015 03:08
Show Gist options
  • Save anonymous/dab32b5b9714b1946883 to your computer and use it in GitHub Desktop.
Save anonymous/dab32b5b9714b1946883 to your computer and use it in GitHub Desktop.
title
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Arrows & Crates
author Benjamin Davis
homepage http://benjamindav.is
again_interval 0.1
color_palette 14
(flickscreen 9x9)
norepeat_action
(verbose_logging)
( Todo:
switches/doors [ operated by arrows or crates/pressure? ]
destructable blocks?
)
========
OBJECTS
========
ArrowUp
LightGrey LightBrown LightRed
..0..
..1..
..1..
..2..
.....
ArrowDown
LightGrey LightBrown LightRed
.....
..2..
..1..
..1..
..0..
ArrowLeft
LightGrey LightBrown LightRed
.....
.....
0112.
.....
.....
ArrowRight
LightGrey LightBrown LightRed
.....
.....
.2110
.....
.....
ArrowPathVertical
Grey
..0..
..0..
..0..
..0..
..0..
ArrowPathHorizontal
Grey
.....
.....
00000
.....
.....
ArcherUp
LightBrown LightGreen Brown Brown
.2...
.20..
01210
.1122
.0.0.
ArcherFiringUp
LightBrown LightGreen Brown Brown
...2.
..02.
.110.
.111.
.0.0.
ArcherDown
LightBrown LightGreen Brown Brown
...2.
..02.
01110
2111.
.0.0.
ArcherFiringDown
LightBrown LightGreen Brown
.2...
.20..
.211.
.211.
.2.0.
ArcherLeft
LightBrown LightGreen Brown
...2.
..02.
.112.
.112.
..0..
ArcherFiringLeft
LightBrown LightGreen Brown
.2...
2..0.
20110
2.111
.20.0
ArcherRight
LightBrown LightGreen Brown
.2...
.20..
.211.
.211.
..0..
ArcherFiringRight
LightBrown LightGreen Brown
...2.
.0..2
01102
111.2
0.02.
Background
Black
Wall
DarkGrey
CornerUpLeft
DarkGrey
0000.
000..
00...
0....
.....
CornerUpRight
DarkGrey
.0000
..000
...00
....0
.....
CornerDownLeft
DarkGrey
.....
0....
00...
000..
0000.
CornerDownRight
DarkGrey
.....
....0
...00
..000
.0000
Solid
DarkBrown
Hollow
DarkBrown
00000
0...0
0...0
0...0
00000
Grooved
DarkBrown
00.00
00.00
.....
00.00
00.00
Exit
Transparent
=======
LEGEND
=======
ArrowVertical = ArrowUp or ArrowDown
ArrowHorizontal = ArrowLeft or ArrowRight
Arrow = ArrowVertical or ArrowHorizontal
ArrowPath = ArrowPathVertical or ArrowPathHorizontal
Archer = ArcherUp or ArcherDown or ArcherLeft or ArcherRight
ArcherFiring = ArcherFiringUp or ArcherFiringDown or ArcherFiringLeft or ArcherFiringRight
Player = Archer
Corner = CornerUpLeft or CornerUpRight or CornerDownLeft or CornerDownRight
Obstacle = Wall or Solid or Corner or Hollow or Grooved
ArcherObstacle = Wall or Solid or Corner or Grooved
ArrowObstacle = Wall or Solid
Crate = Solid or Hollow or Grooved
. = Background
░ = Wall
■ = Solid
□ = Hollow
⌑ = Grooved
x = Exit
┘ = CornerUpLeft
└ = CornerUpRight
┐ = CornerDownLeft
┌ = CornerDownRight
▲ = ArcherUp
▼ = ArcherDown
◄ = ArcherLeft
► = ArcherRight
↑ = ArrowUp
↓ = ArrowDown
← = ArrowLeft
→ = ArrowRight
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
Exit
ArrowPathVertical
ArrowPathHorizontal
Arrow
Archer, ArcherFiring
Wall, Solid, Corner, Hollow, Grooved
======
RULES
======
( Mark arrows embedded in solids )
up [ ArrowUp | Solid ] -> [ action ArrowUp | Solid ]
down [ ArrowDown | Solid ] -> [ action ArrowDown | Solid ]
left [ ArrowLeft | Solid ] -> [ action ArrowLeft | Solid ]
right [ ArrowRight | Solid ] -> [ action ArrowRight | Solid ]
( Player pushes solids )
rigid [ > Archer no Hollow | Solid ] -> [ > Archer | > Solid ]
( Player pushes grooveds )
+ rigid [ > Archer no Hollow | Grooved ] -> [ > Archer | > Grooved ]
( Player pushes sides of arrows )
+ rigid vertical [ > Archer no Hollow | action ArrowHorizontal | no ArrowObstacle no Grooved no Corner ] -> [ > Archer | > ArrowHorizontal | ]
+ rigid horizontal [ > Archer no Hollow | action ArrowVertical | no ArrowObstacle no Grooved no Corner ] -> [ > Archer | > ArrowVertical | ]
( Arrows push solids )
+ rigid up [ orthogonal ArrowUp | Solid ] -> [ orthogonal ArrowUp | orthogonal Solid ]
+ rigid down [ orthogonal ArrowDown | Solid ] -> [ orthogonal ArrowDown | orthogonal Solid ]
+ rigid left [ orthogonal ArrowLeft | Solid ] -> [ orthogonal ArrowLeft | orthogonal Solid ]
+ rigid right [ orthogonal ArrowRight | Solid ] -> [ orthogonal ArrowRight | orthogonal Solid ]
( Solids push arrows )
+ rigid up [ ArrowUp | orthogonal Solid ] -> [ orthogonal ArrowUp | orthogonal Solid ]
+ rigid down [ ArrowDown | orthogonal Solid ] -> [ orthogonal ArrowDown | orthogonal Solid ]
+ rigid left [ ArrowLeft | orthogonal Solid ] -> [ orthogonal ArrowLeft | orthogonal Solid ]
+ rigid right [ ArrowRight | orthogonal Solid ] -> [ orthogonal ArrowRight | orthogonal Solid ]
( Arrows push grooveds they're residing in )
+ rigid vertical [ Grooved > ArrowHorizontal ] -> [ > ArrowHorizontal > Grooved ]
+ rigid horizontal [ Grooved > ArrowVertical ] -> [ > ArrowVertical > Grooved ]
( Grooveds push arrows inside them )
+ rigid vertical [ action ArrowHorizontal > Grooved ] -> [ > ArrowHorizontal > Grooved ]
+ rigid horizontal [ action ArrowVertical > Grooved ] -> [ > ArrowVertical > Grooved ]
( Crates push crates )
+ rigid [ > Crate | Crate ] -> [ > Crate | > Crate ]
( Crush arrows )
+ rigid [ > Arrow | stationary ArrowObstacle ] -> [ | ArrowObstacle ]
+ rigid [ > Arrow | stationary Corner ] -> [ | Corner ]
+ rigid [ action Arrow | < ArrowObstacle ] -> [ | ArrowObstacle ]
+ rigid [ stationary Arrow | < ArrowObstacle ] -> [ | ArrowObstacle ]
+ rigid vertical [ > ArrowHorizontal | stationary Grooved ] -> [ | Grooved ]
+ rigid horizontal [ > ArrowVertical | stationary Grooved ] -> [ | Grooved ]
+ rigid vertical [ action ArrowHorizontal | < Grooved ] -> [ | < Grooved ]
+ rigid horizontal [ action ArrowVertical | < Grooved ] -> [ | < Grooved ]
+ rigid vertical [ stationary ArrowHorizontal | < Grooved ] -> [ | < Grooved ]
+ rigid horizontal [ stationary ArrowVertical | < Grooved ] -> [ | < Grooved ]
+ rigid vertical [ stationary ArrowHorizontal > Grooved ] -> [ > Grooved ]
+ rigid horizontal [ stationary ArrowVertical > Grooved ] -> [ > Grooved ]
( Pick up any arrows stuck in walls )
([ > Archer | stationary Arrow no ArcherObstacle ] -> [ > Archer | ])
( Unmark arrows )
[ action Arrow ] -> [ Arrow ]
( Pick up arrows from the back )
vertical [ > Archer | ArrowVertical no ArcherObstacle ] -> [ > Archer | ]
horizontal [ > Archer | ArrowHorizontal no ArcherObstacle ] -> [ > Archer | ]
( Mark if there's room or not )
up [ ArcherFiringUp | no ArrowObstacle ] -> [ action ArcherFiringUp | ]
down [ ArcherFiringDown | no ArrowObstacle ] -> [ action ArcherFiringDown | ]
left [ ArcherFiringLeft | no ArrowObstacle ] -> [ action ArcherFiringLeft | ]
right [ ArcherFiringRight | no ArrowObstacle ] -> [ action ArcherFiringRight | ]
( Move back if no room to fire )
up [ no ArcherObstacle | stationary ArcherFiringUp ] -> [ action ArcherFiringUp | ]
down [ no ArcherObstacle | stationary ArcherFiringDown ] -> [ action ArcherFiringDown | ]
left [ no ArcherObstacle | stationary ArcherFiringLeft ] -> [ action ArcherFiringLeft | ]
right [ no ArcherObstacle | stationary ArcherFiringRight ] -> [ action ArcherFiringRight | ]
( Remove arrow path )
[ ArrowPath ] [ ArcherFiring ] -> [ ] [ stationary ArcherFiring ]
( Revert back to moving state )
[ stationary ArcherFiringUp ] -> [ ArcherUp ]
[ stationary ArcherFiringDown ] -> [ ArcherDown ]
[ stationary ArcherFiringLeft ] -> [ ArcherLeft ]
[ stationary ArcherFiringRight ] -> [ ArcherRight ]
( Spawn new arrow when there's space )
up [ ArcherFiringUp | no ArrowObstacle ] -> [ ArcherFiringUp | ArrowUp ArrowPathVertical ] again
down [ ArcherFiringDown | no ArrowObstacle ] -> [ ArcherFiringDown | ArrowDown ArrowPathVertical ] again
left [ ArcherFiringLeft | no ArrowObstacle ] -> [ ArcherFiringLeft | ArrowLeft ArrowPathHorizontal ] again
right [ ArcherFiringRight | no ArrowObstacle ] -> [ ArcherFiringRight | ArrowRight ArrowPathHorizontal ] again
( Arrows bounce off corners )
up [ ArrowUp CornerUpLeft ] -> [ CornerUpLeft ArrowRight ArrowPathVertical ArrowPathHorizontal ] again
+ up [ ArrowUp CornerUpRight ] -> [ CornerUpRight ArrowLeft ArrowPathVertical ArrowPathHorizontal ] again
+ down [ ArrowDown CornerDownLeft ] -> [ CornerDownLeft ArrowRight ArrowPathVertical ArrowPathHorizontal ] again
+ down [ ArrowDown CornerDownRight ] -> [ CornerDownRight ArrowLeft ArrowPathVertical ArrowPathHorizontal ] again
+ left [ ArrowLeft CornerUpLeft ] -> [ CornerUpLeft ArrowDown ArrowPathVertical ArrowPathHorizontal ] again
+ left [ ArrowLeft CornerDownLeft ] -> [ CornerDownLeft ArrowUp ArrowPathVertical ArrowPathHorizontal ] again
+ right [ ArrowRight CornerUpRight ] -> [ CornerUpRight ArrowDown ArrowPathVertical ArrowPathHorizontal ] again
+ right [ ArrowRight CornerDownRight ] -> [ CornerDownRight ArrowUp ArrowPathVertical ArrowPathHorizontal ] again
( Make arrows fly )
+ up [ ArrowUp | no ArrowObstacle ] -> [ | ArrowUp ArrowPathVertical ] again
+ down [ ArrowDown | no ArrowObstacle ] -> [ | ArrowDown ArrowPathVertical ] again
+ left [ ArrowLeft | no ArrowObstacle ] -> [ | ArrowLeft ArrowPathHorizontal ] again
+ right [ ArrowRight | no ArrowObstacle ] -> [ | ArrowRight ArrowPathHorizontal ] again
( Archer catches arrow )
+ [ Arrow ArcherFiring ] -> [ ArcherFiring ]
( Remove arrows stuck in corners )
up [ ArrowUp Corner | ArrowObstacle ] -> [ Corner | ArrowObstacle ]
down [ ArrowDown Corner | ArrowObstacle ] -> [ Corner | ArrowObstacle ]
left [ ArrowLeft Corner | ArrowObstacle ] -> [ Corner | ArrowObstacle ]
right [ ArrowRight Corner | ArrowObstacle ] -> [ Corner | ArrowObstacle ]
( Enter firing mode )
[ action ArcherUp ] -> [ ArcherFiringUp ] again
[ action ArcherDown ] -> [ ArcherFiringDown ] again
[ action ArcherLeft ] -> [ ArcherFiringLeft ] again
[ action ArcherRight ] -> [ ArcherFiringRight ] again
( Archer faces walking direction )
up [ > Archer ] -> [ > ArcherUp ]
down [ > Archer ] -> [ > ArcherDown ]
left [ > Archer ] -> [ > ArcherLeft ]
right [ > Archer ] -> [ > ArcherRight ]
( Stop player walking through arrows )
[ > Archer | stationary Arrow ] -> [ Archer | Arrow ]
( Stop player walking through obstacles )
[ > Archer | stationary ArcherObstacle ] -> [ Archer | ArcherObstacle ]
[ > Archer | > ArcherObstacle | stationary Obstacle ] -> [ Archer | > ArcherObstacle | Obstacle ]
( Win when player walks out the exit )
[ > Player Exit | ] -> [ > Player action Exit | ]
[ > Player stationary Exit ] -> win
==============
WINCONDITIONS
==============
=======
LEVELS
=======
...░■░...
...░.░...
..░░■░░..
░░░...░░░
►....■..x
░░░..■░░░
..░░.░░..
...░■░...
...░.░...
.........
..░░░░░..
.░░░■░░░.
░░░...░░░
►.■..■..x
░░░..░░░░
.░░.■.░░.
..░░░░░..
.........
(.........
..░░░░░..
.░░..└░░.
░░┘....░░
►...■...x
░░....┌░░
.░░┐..░░.
..░░░░░..
.........)
.........
..░░░░░..
.░░░.░░░.
░░░░.░░░░
►...■...x
░░┘.■░░░░
.░..░░░░.
..░░░░░..
.........
...░■░...
...░.░...
..░░.░░..
░░░┘.└░..
►.⌑..┌░..
░░░■..░..
..░░.░░..
...░.░...
...░x░...
(...░▼░...
..░░.░░..
..░...░..
░░░..■░░░
...■■..■■
░..░░░.■░
░......■░
░░.....░░
.░░░░░░░.)
(...░▼░...
.░░┘.└░░.
.░..■■.░.
░░.■.░■░░
..■.░■...
░░□...■░░
.░⌑.■..└░
.░░░■⌑□┌░
...░.░░░░)
..┌░▼░┐..
.░░┘.└░░.
┌░..■■.░┐
░┘.■.░.└░
x.■.░■..■
░┐□....┌░
└░⌑.■..░┘
.░░┐■.░░.
..└░.░┘..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment