Skip to content

Instantly share code, notes, and snippets.

Created March 3, 2015 07:43
Show Gist options
  • Save anonymous/55e90632b902b2f074d6 to your computer and use it in GitHub Desktop.
Save anonymous/55e90632b902b2f074d6 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 Space Junk
author Benjamin Davis
homepage bnhw.co.uk
again_interval 0.05
norepeat_action
run_rules_on_level_start
background_color #302B2B
========
OBJECTS
========
Background .
#0d0d0d
Tug @
#FF9E48
Red R
#FF5136
Green G
#AED876
Pink P
#DF5A93
Yellow Y
#f9dc77
Junk #
#302B2B
MaleConnectorUp ┴
#695F5F
.....
..0..
..0..
..00.
.000.
MaleConnectorDown ┬
#695F5F
.000.
.00..
..0..
..0..
.....
MaleConnectorLeft ┤
#695F5F
.....
...00
.0000
....0
.....
MaleConnectorRight ├
#695F5F
.....
0....
0000.
00...
.....
FemaleConnectorUp ╨
#594E4E
.....
...0.
.0.0.
.0.0.
.000.
FemaleConnectorDown ╥
#594E4E
.000.
.0.0.
.0.0.
.0...
.....
FemaleConnectorLeft ╡
#594E4E
.....
.0000
....0
..000
.....
FemaleConnectorRight ╞
#594E4E
.....
000..
0....
0000.
.....
One S1
Transparent
.....
..0..
..0..
..0..
.....
Two S2
Transparent
.....
.00..
..0..
..00.
.....
Three S3
Transparent
.....
.000.
..00.
.000.
.....
Four S4
Transparent
.....
.0.0.
.000.
...0.
.....
Five S5
Transparent
.....
..00.
..0..
.00..
.....
Six S6
Transparent
.....
.0...
.000.
.000.
.....
=======
LEGEND
=======
Player = Tug
Ship = Red or Green or Pink or Yellow
MaleConnector = MaleConnectorUp or MaleConnectorDown or MaleConnectorLeft or MaleConnectorRight
MaleConnectorNotUp = MaleConnectorDown or MaleConnectorLeft or MaleConnectorRight
MaleConnectorNotDown = MaleConnectorUp or MaleConnectorLeft or MaleConnectorRight
MaleConnectorNotLeft = MaleConnectorUp or MaleConnectorDown or MaleConnectorRight
MaleConnectorNotRight = MaleConnectorUp or MaleConnectorDown or MaleConnectorLeft
MaleConnectorHorizontal = MaleConnectorLeft or MaleConnectorRight
MaleConnectorVertical = MaleConnectorUp or MaleConnectorDown
FemaleConnector = FemaleConnectorUp or FemaleConnectorDown or FemaleConnectorLeft or FemaleConnectorRight
FemaleConnectorNotUp = FemaleConnectorDown or FemaleConnectorLeft or FemaleConnectorRight
FemaleConnectorNotDown = FemaleConnectorUp or FemaleConnectorLeft or FemaleConnectorRight
FemaleConnectorNotLeft = FemaleConnectorUp or FemaleConnectorDown or FemaleConnectorRight
FemaleConnectorNotRight = FemaleConnectorUp or FemaleConnectorDown or FemaleConnectorLeft
FemaleConnectorHorizontal = FemaleConnectorLeft or FemaleConnectorRight
FemaleConnectorVertical = FemaleConnectorUp or FemaleConnectorDown
Connector = MaleConnector or FemaleConnector
ConnectorUp = MaleConnectorUp or FemaleConnectorUp
ConnectorDown = MaleConnectorDown or FemaleConnectorDown
ConnectorLeft = MaleConnectorLeft or FemaleConnectorLeft
ConnectorRight = MaleConnectorRight or FemaleConnectorRight
Pushable = Connector or Ship
Number = S1 or S2 or S3 or S4 or S5 or S6
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
Tug, Ship, FemaleConnector, Junk
MaleConnector
Number
======
RULES
======
( Setup ship numbers )
random [ no Ship | no Ship | no Ship | no Ship | no Ship | no Ship ] -> [ S1 | S2 | S3 | S4 | S5 | S6 ]
( Assign numbers to ships )
startloop
random [ Number no Ship ] [ Ship no Number ] -> [ ] [ Ship Number ]
[ Red no Number | Red Number ] -> [ Red Number | Red Number ]
[ Pink no Number | Pink Number ] -> [ Pink Number | Pink Number ]
[ Green no Number | Green Number ] -> [ Green Number | Green Number ]
[ Yellow no Number | Yellow Number ] -> [ Yellow Number | Yellow Number ]
endloop
( Remove unused numbers )
[ Number no Ship ] -> [ ]
( Tug pushes things )
[ > Tug | Pushable ] -> [ > Tug | > Pushable ]
( Ship parts move together )
rigid [ moving Ship S1 | Ship S1 ] -> [ moving Ship S1 | moving Ship S1 ]
+ rigid [ moving Ship S2 | Ship S2 ] -> [ moving Ship S2 | moving Ship S2 ]
+ rigid [ moving Ship S3 | Ship S3 ] -> [ moving Ship S3 | moving Ship S3 ]
+ rigid [ moving Ship S4 | Ship S4 ] -> [ moving Ship S4 | moving Ship S4 ]
+ rigid [ moving Ship S5 | Ship S5 ] -> [ moving Ship S5 | moving Ship S5 ]
+ rigid [ moving Ship S6 | Ship S6 ] -> [ moving Ship S6 | moving Ship S6 ]
( Ships push ships they're not connected to )
+ rigid [ > Ship | Ship ] -> [ > Ship | > Ship ]
( Ships push connectors they're not connected to )
+ rigid [ > Ship | Connector ] -> [ > Ship | > Connector ]
( Connectors push ships they're not connected to )
+ rigid [ Ship | < Connector ] -> [ < Ship | < Connector ]
( Male connectors push male connectors )
+ rigid [ > MaleConnector | MaleConnector ] -> [ > MaleConnector | > MaleConnector ]
( Female connectors push female connectors )
+ rigid [ > FemaleConnector | FemaleConnector ] -> [ > FemaleConnector | > FemaleConnector ]
( Connectors push differently-orientated connectors )
+ rigid [ > MaleConnectorUp | FemaleConnectorNotDown ] -> [ > MaleConnectorUp | > FemaleConnectorNotDown ]
+ rigid [ > MaleConnectorDown | FemaleConnectorNotUp ] -> [ > MaleConnectorDown | > FemaleConnectorNotUp ]
+ rigid [ > MaleConnectorLeft | FemaleConnectorNotRight ] -> [ > MaleConnectorLeft | > FemaleConnectorNotRight ]
+ rigid [ > MaleConnectorRight | FemaleConnectorNotLeft ] -> [ > MaleConnectorRight | > FemaleConnectorNotLeft ]
+ rigid [ > FemaleConnectorUp | MaleConnectorNotDown ] -> [ > FemaleConnectorUp | > MaleConnectorNotDown ]
+ rigid [ > FemaleConnectorDown | MaleConnectorNotUp ] -> [ > FemaleConnectorDown | > MaleConnectorNotUp ]
+ rigid [ > FemaleConnectorLeft | MaleConnectorNotRight ] -> [ > FemaleConnectorLeft | > MaleConnectorNotRight ]
+ rigid [ > FemaleConnectorRight | MaleConnectorNotLeft ] -> [ > FemaleConnectorRight | > MaleConnectorNotLeft ]
( Connectors push correctly-orientated connectors from wrong direction )
+ vertical rigid [ > MaleConnectorLeft | FemaleConnectorRight ] -> [ > MaleConnectorLeft | > FemaleConnectorRight ]
+ vertical rigid [ > MaleConnectorRight | FemaleConnectorLeft ] -> [ > MaleConnectorRight | > FemaleConnectorLeft ]
+ horizontal rigid [ > MaleConnectorUp | FemaleConnectorDown ] -> [ > MaleConnectorUp | > FemaleConnectorDown ]
+ horizontal rigid [ > MaleConnectorDown | FemaleConnectorUp ] -> [ > MaleConnectorDown | > FemaleConnectorUp ]
+ vertical rigid [ > FemaleConnectorLeft | MaleConnectorRight ] -> [ > FemaleConnectorLeft | > MaleConnectorRight ]
+ vertical rigid [ > FemaleConnectorRight | MaleConnectorLeft ] -> [ > FemaleConnectorRight | > MaleConnectorLeft ]
+ horizontal rigid [ > FemaleConnectorUp | MaleConnectorDown ] -> [ > FemaleConnectorUp | > MaleConnectorDown ]
+ horizontal rigid [ > FemaleConnectorDown | MaleConnectorUp ] -> [ > FemaleConnectorDown | > MaleConnectorUp ]
( Connectors move the ships they're on )
+ up rigid [ moving ConnectorDown | Ship ] -> [ moving ConnectorDown | moving Ship ]
+ down rigid [ moving ConnectorUp | Ship ] -> [ moving ConnectorUp | moving Ship ]
+ left rigid [ moving ConnectorRight | Ship ] -> [ moving ConnectorRight | moving Ship ]
+ right rigid [ moving ConnectorLeft | Ship ] -> [ moving ConnectorLeft | moving Ship ]
( Ships move connectors that're on them )
+ up rigid [ ConnectorDown | moving Ship ] -> [ moving ConnectorDown | moving Ship ]
+ down rigid [ ConnectorUp | moving Ship ] -> [ moving ConnectorUp | moving Ship ]
+ left rigid [ ConnectorRight | moving Ship ] -> [ moving ConnectorRight | moving Ship ]
+ right rigid [ ConnectorLeft | moving Ship ] -> [ moving ConnectorLeft | moving Ship ]
( Connectors move connected connectors (if they're not disconnecting) )
+ rigid [ vertical MaleConnectorHorizontal FemaleConnectorHorizontal ] -> [ vertical MaleConnectorHorizontal vertical FemaleConnectorHorizontal ]
+ rigid [ MaleConnectorHorizontal vertical FemaleConnectorHorizontal ] -> [ vertical MaleConnectorHorizontal vertical FemaleConnectorHorizontal ]
+ rigid [ horizontal MaleConnectorVertical FemaleConnectorVertical ] -> [ horizontal MaleConnectorVertical horizontal FemaleConnectorVertical ]
+ rigid [ MaleConnectorVertical horizontal FemaleConnectorVertical ] -> [ horizontal MaleConnectorVertical horizontal FemaleConnectorVertical ]
( Ensure ships stay rigid )
[ stationary Ship S1 | moving Ship S1 ] -> [ Ship S1 | Ship S1 ]
[ stationary Ship S2 | moving Ship S2 ] -> [ Ship S2 | Ship S2 ]
[ stationary Ship S3 | moving Ship S3 ] -> [ Ship S3 | Ship S3 ]
[ stationary Ship S4 | moving Ship S4 ] -> [ Ship S4 | Ship S4 ]
[ stationary Ship S5 | moving Ship S5 ] -> [ Ship S5 | Ship S5 ]
[ stationary Ship S6 | moving Ship S6 ] -> [ Ship S6 | Ship S6 ]
( Connectors stop when the ships they're on are stopped )
up [ moving ConnectorDown | stationary Ship ] -> [ ConnectorDown | Ship ]
down [ moving ConnectorUp | stationary Ship ] -> [ ConnectorUp | Ship ]
left [ moving ConnectorRight | stationary Ship ] -> [ ConnectorRight | Ship ]
right [ moving ConnectorLeft | stationary Ship ] -> [ ConnectorLeft | Ship ]
( Ships stop connectors that're on them are stopped )
up [ stationary ConnectorDown | moving Ship ] -> [ ConnectorDown | Ship ]
down [ stationary ConnectorUp | moving Ship ] -> [ ConnectorUp | Ship ]
left [ stationary ConnectorRight | moving Ship ] -> [ ConnectorRight | Ship ]
right [ stationary ConnectorLeft | moving Ship ] -> [ ConnectorLeft | Ship ]
( Tug stops if it can't push )
[ > Tug | stationary Pushable ] -> [ Tug | Pushable ]
( Move numbers with ships )
[ moving Ship Number ] -> [ moving Ship moving Number ]
==============
WINCONDITIONS
==============
All MaleConnector on FemaleConnector
All FemaleConnector on MaleConnector
=======
LEVELS
=======
#....###
#..r.┤r#
r├╡r╞.r#
r..r....
#.......
#..@....
.......
....┴..
...rr..
..╡gg..
╨..g@..
p├.rr..
pp.┬...
.╥.....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment