Skip to content

Instantly share code, notes, and snippets.

@raggy
Forked from anonymous/readme.txt
Last active May 25, 2017 15:00
Show Gist options
  • Save raggy/b827859931ad4a879a74 to your computer and use it in GitHub Desktop.
Save raggy/b827859931ad4a879a74 to your computer and use it in GitHub Desktop.
Space Junker 2
title Space Junker 2
author Benjamin Davis
homepage benjamindav.is
noaction
run_rules_on_level_start
(debug)
(verbose_logging)
========
OBJECTS
========
Background
Black
Wall
DarkGreen
Player
Orange White
00000
01110
00100
01110
00000
Red
Red
Green
LightGreen
Pink
LightRed
Yellow
LightBrown
ShipUnpowered
DarkBlue
.....
..0..
.000.
..0..
.....
ShipPowered
White
.....
..0..
.000.
..0..
.....
Core
White
.....
.000.
.000.
.000.
.....
FusedUpUnpowered
DarkBlue
.000.
.0.0.
.....
.....
.....
FusedDownUnpowered
DarkBlue
.....
.....
.....
.0.0.
.000.
FusedLeftUnpowered
DarkBlue
.....
00...
0....
00...
.....
FusedRightUnpowered
DarkBlue
.....
...00
....0
...00
.....
FusedUpPowered
White
.000.
.0.0.
.....
.....
.....
FusedDownPowered
White
.....
.....
.....
.0.0.
.000.
FusedLeftPowered
White
.....
00...
0....
00...
.....
FusedRightPowered
White
.....
...00
....0
...00
.....
LaserUp
White
..0..
..0..
..0..
..0..
.000.
LaserDown
White
.000.
..0..
..0..
..0..
..0..
LaserLeft
White
.....
....0
00000
....0
.....
LaserRight
White
.....
0....
00000
0....
.....
MaleConnectorUp
Grey
.....
..0..
..0..
..00.
.000.
MaleConnectorDown
Grey
.000.
.00..
..0..
..0..
.....
MaleConnectorLeft
Grey
.....
...00
.0000
....0
.....
MaleConnectorRight
Grey
.....
0....
0000.
00...
.....
FemaleConnectorUp
DarkGrey
.....
...0.
.0.0.
.0.0.
.000.
FemaleConnectorDown
DarkGrey
.000.
.0.0.
.0.0.
.0...
.....
FemaleConnectorLeft
DarkGrey
.....
.0000
....0
..000
.....
FemaleConnectorRight
DarkGrey
.....
000..
0....
0000.
.....
Blocked
Blue
.000.
00..0
0.0.0
0..00
.000.
Connected
Transparent
.....
..0..
.000.
..0..
.....
=======
LEGEND
=======
Ship = ShipUnpowered or ShipPowered
FusedUp = FusedUpUnpowered or FusedUpPowered
FusedDown = FusedDownUnpowered or FusedDownPowered
FusedLeft = FusedLeftUnpowered or FusedLeftPowered
FusedRight = FusedRightUnpowered or FusedRightPowered
Color = Red or Green or Pink or Yellow
Fused = FusedUp or FusedDown or FusedLeft or FusedRight
Laser = LaserUp or LaserDown or LaserLeft or LaserRight
MaleConnector = MaleConnectorUp or MaleConnectorDown or MaleConnectorLeft or MaleConnectorRight
FemaleConnector = FemaleConnectorUp or FemaleConnectorDown or FemaleConnectorLeft or FemaleConnectorRight
ConnectorUp = MaleConnectorUp or FemaleConnectorUp
ConnectorDown = MaleConnectorDown or FemaleConnectorDown
ConnectorLeft = MaleConnectorLeft or FemaleConnectorLeft
ConnectorRight = MaleConnectorRight or FemaleConnectorRight
Connector = ConnectorUp or ConnectorDown or ConnectorLeft or ConnectorRight
AttachmentUp = LaserUp or ConnectorUp
AttachmentDown = LaserDown or ConnectorDown
AttachmentLeft = LaserLeft or ConnectorLeft
AttachmentRight = LaserRight or ConnectorRight
Attachment = AttachmentUp or AttachmentDown or AttachmentLeft or AttachmentRight
Pushable = Ship or Attachment
. = Background
@ = Player
r = Red
g = Green
p = Pink
y = Yellow
ṙ = Red and Core
ġ = Green and Core
ṗ = Pink and Core
ẏ = Yellow and Core
▓ = Wall
▒ = Wall
░ = Wall
↓ = LaserUp
↑ = LaserDown
→ = LaserLeft
← = LaserRight
┴ = MaleConnectorUp
┬ = MaleConnectorDown
┤ = MaleConnectorLeft
├ = MaleConnectorRight
╨ = FemaleConnectorUp
╥ = FemaleConnectorDown
╡ = FemaleConnectorLeft
╞ = FemaleConnectorRight
║ = MaleConnectorUp and FemaleConnectorDown
│ = MaleConnectorDown and FemaleConnectorUp
═ = MaleConnectorLeft and FemaleConnectorRight
─ = MaleConnectorRight and FemaleConnectorLeft
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
Color
Wall, Player, Ship, Laser
FusedUp, MaleConnector
FusedDown, FemaleConnector
FusedLeft
FusedRight
Core
Blocked, Connected
======
RULES
======
( Clear connectedness )
[ Connected ] -> [ ]
( Connectedness spreads from Cores )
late [ Core ] -> [ Connected Core ]
( Ship parts are connected to each other )
late up [ Connected Ship FusedUp | Ship ] -> [ Connected Ship FusedUp | Connected Ship ]
+ late down [ Connected Ship FusedDown | Ship ] -> [ Connected Ship FusedDown | Connected Ship ]
+ late left [ Connected Ship FusedLeft | Ship ] -> [ Connected Ship FusedLeft | Connected Ship ]
+ late right [ Connected Ship FusedRight | Ship ] -> [ Connected Ship FusedRight | Connected Ship ]
( Ships connected to ships of the same colour are connected )
+ late [ Connected Red | FemaleConnector MaleConnector | Red ] -> [ Connected Red | Connected FemaleConnector MaleConnector | Connected Red ]
+ late [ Connected Green | FemaleConnector MaleConnector | Green ] -> [ Connected Green | Connected FemaleConnector MaleConnector | Connected Green ]
+ late [ Connected Pink | FemaleConnector MaleConnector | Pink ] -> [ Connected Green | Connected FemaleConnector MaleConnector | Connected Pink ]
+ late [ Connected Yellow | FemaleConnector MaleConnector | Yellow ] -> [ Connected Yellow | Connected FemaleConnector MaleConnector | Connected Yellow ]
( Disconnected connectors count )
late up [ Connected Ship | MaleConnectorUp no FemaleConnectorDown ] -> [ Connected Ship | Connected MaleConnectorUp ]
late down [ Connected Ship | MaleConnectorDown no FemaleConnectorUp ] -> [ Connected Ship | Connected MaleConnectorDown ]
late left [ Connected Ship | MaleConnectorLeft no FemaleConnectorRight ] -> [ Connected Ship | Connected MaleConnectorLeft ]
late right [ Connected Ship | MaleConnectorRight no FemaleConnectorLeft ] -> [ Connected Ship | Connected MaleConnectorRight ]
late up [ Connected Ship | FemaleConnectorUp no MaleConnectorDown ] -> [ Connected Ship | Connected FemaleConnectorUp ]
late down [ Connected Ship | FemaleConnectorDown no MaleConnectorUp ] -> [ Connected Ship | Connected FemaleConnectorDown ]
late left [ Connected Ship | FemaleConnectorLeft no MaleConnectorRight ] -> [ Connected Ship | Connected FemaleConnectorLeft ]
late right [ Connected Ship | FemaleConnectorRight no MaleConnectorLeft ] -> [ Connected Ship | Connected FemaleConnectorRight ]
( Mark for fusing )
[ Color no Ship ] -> [ action Color ]
( Fuse adjacent parts together )
up [ action Red | Red ] -> [ action Red FusedUpUnpowered | Red ]
down [ action Red | Red ] -> [ action Red FusedDownUnpowered | Red ]
left [ action Red | Red ] -> [ action Red FusedLeftUnpowered | Red ]
right [ action Red | Red ] -> [ action Red FusedRightUnpowered | Red ]
up [ action Green | Green ] -> [ action Green FusedUpUnpowered | Green ]
down [ action Green | Green ] -> [ action Green FusedDownUnpowered | Green ]
left [ action Green | Green ] -> [ action Green FusedLeftUnpowered | Green ]
right [ action Green | Green ] -> [ action Green FusedRightUnpowered | Green ]
up [ action Pink | Pink ] -> [ action Pink FusedUpUnpowered | Pink ]
down [ action Pink | Pink ] -> [ action Pink FusedDownUnpowered | Pink ]
left [ action Pink | Pink ] -> [ action Pink FusedLeftUnpowered | Pink ]
right [ action Pink | Pink ] -> [ action Pink FusedRightUnpowered | Pink ]
up [ action Yellow | Yellow ] -> [ action Yellow FusedUpUnpowered | Yellow ]
down [ action Yellow | Yellow ] -> [ action Yellow FusedDownUnpowered | Yellow ]
left [ action Yellow | Yellow ] -> [ action Yellow FusedLeftUnpowered | Yellow ]
right [ action Yellow | Yellow ] -> [ action Yellow FusedRightUnpowered | Yellow ]
( Reset fusing marks and create ships )
[ action Color ] -> [ Color ShipUnpowered ]
( Player pushes pushables )
[ > Player | Pushable ] -> [ > Player | > Pushable ]
startloop
( Ship parts pull fused parts with them )
up [ orthogonal Ship FusedUp | stationary Ship ] -> [ orthogonal Ship FusedUp | orthogonal Ship ]
+ down [ orthogonal Ship FusedDown | stationary Ship ] -> [ orthogonal Ship FusedDown | orthogonal Ship ]
+ left [ orthogonal Ship FusedLeft | stationary Ship ] -> [ orthogonal Ship FusedLeft | orthogonal Ship ]
+ right [ orthogonal Ship FusedRight | stationary Ship ] -> [ orthogonal Ship FusedRight | orthogonal Ship ]
( Ship parts pull attachments with them )
+ up [ orthogonal Ship | stationary AttachmentUp ] -> [ orthogonal Ship | orthogonal AttachmentUp ]
+ down [ orthogonal Ship | stationary AttachmentDown ] -> [ orthogonal Ship | orthogonal AttachmentDown ]
+ left [ orthogonal Ship | stationary AttachmentLeft ] -> [ orthogonal Ship | orthogonal AttachmentLeft ]
+ right [ orthogonal Ship | stationary AttachmentRight ] -> [ orthogonal Ship | orthogonal AttachmentRight ]
( Attachments pull ship parts with them )
+ up [ stationary Ship | orthogonal AttachmentUp ] -> [ orthogonal Ship | orthogonal AttachmentUp ]
+ down [ stationary Ship | orthogonal AttachmentDown ] -> [ orthogonal Ship | orthogonal AttachmentDown ]
+ left [ stationary Ship | orthogonal AttachmentLeft ] -> [ orthogonal Ship | orthogonal AttachmentLeft ]
+ right [ stationary Ship | orthogonal AttachmentRight ] -> [ orthogonal Ship | orthogonal AttachmentRight ]
( Ships push other ships )
+ [ > Ship | stationary Ship ] -> [ > Ship | > Ship ]
( Attachments push ships )
+ [ > Attachment | stationary Ship ] -> [ > Attachment | > Ship ]
( Ships push attachments )
+ [ > Ship | stationary Attachment ] -> [ > Ship | > Attachment ]
( Non-connector attachments push attachments )
+ [ > Attachment no Connector | stationary Attachment ] -> [ > Attachment | > Attachment ]
( Connectors push non-connector attachments )
+ [ > Connector | stationary Attachment no Connector ] -> [ > Connector | > Attachment ]
( Male connectors push male connectors )
+ [ > MaleConnector | stationary MaleConnector ] -> [ > MaleConnector | > MaleConnector ]
( Female connectors push female connectors )
+ [ > FemaleConnector | stationary FemaleConnector ] -> [ > FemaleConnector | > FemaleConnector ]
( Connectors push differently-orientated connectors )
+ [ > MaleConnectorUp | stationary FemaleConnector no ConnectorDown ] -> [ > MaleConnectorUp | > FemaleConnector ]
+ [ > MaleConnectorDown | stationary FemaleConnector no ConnectorUp ] -> [ > MaleConnectorDown | > FemaleConnector ]
+ [ > MaleConnectorLeft | stationary FemaleConnector no ConnectorRight ] -> [ > MaleConnectorLeft | > FemaleConnector ]
+ [ > MaleConnectorRight | stationary FemaleConnector no ConnectorLeft ] -> [ > MaleConnectorRight | > FemaleConnector ]
+ [ > FemaleConnectorUp | stationary MaleConnector no ConnectorDown ] -> [ > FemaleConnectorUp | > MaleConnector ]
+ [ > FemaleConnectorDown | stationary MaleConnector no ConnectorUp ] -> [ > FemaleConnectorDown | > MaleConnector ]
+ [ > FemaleConnectorLeft | stationary MaleConnector no ConnectorRight ] -> [ > FemaleConnectorLeft | > MaleConnector ]
+ [ > FemaleConnectorRight | stationary MaleConnector no ConnectorLeft ] -> [ > FemaleConnectorRight | > MaleConnector ]
( Connectors push correctly-orientated connectors from wrong direction )
+ vertical [ > MaleConnectorLeft | stationary FemaleConnectorRight ] -> [ > MaleConnectorLeft | > FemaleConnectorRight ]
+ vertical [ > MaleConnectorRight | stationary FemaleConnectorLeft ] -> [ > MaleConnectorRight | > FemaleConnectorLeft ]
+ horizontal [ > MaleConnectorUp | stationary FemaleConnectorDown ] -> [ > MaleConnectorUp | > FemaleConnectorDown ]
+ horizontal [ > MaleConnectorDown | stationary FemaleConnectorUp ] -> [ > MaleConnectorDown | > FemaleConnectorUp ]
+ vertical [ > FemaleConnectorLeft | stationary MaleConnectorRight ] -> [ > FemaleConnectorLeft | > MaleConnectorRight ]
+ vertical [ > FemaleConnectorRight | stationary MaleConnectorLeft ] -> [ > FemaleConnectorRight | > MaleConnectorLeft ]
+ horizontal [ > FemaleConnectorUp | stationary MaleConnectorDown ] -> [ > FemaleConnectorUp | > MaleConnectorDown ]
+ horizontal [ > FemaleConnectorDown | stationary MaleConnectorUp ] -> [ > FemaleConnectorDown | > MaleConnectorUp ]
( Connectors move connected connectors in perpendicular directions )
+ [ horizontal MaleConnectorUp stationary FemaleConnectorDown ] -> [ horizontal MaleConnectorUp horizontal FemaleConnectorDown ]
+ [ horizontal MaleConnectorDown stationary FemaleConnectorUp ] -> [ horizontal MaleConnectorDown horizontal FemaleConnectorUp ]
+ [ stationary MaleConnectorUp horizontal FemaleConnectorDown ] -> [ horizontal MaleConnectorUp horizontal FemaleConnectorDown ]
+ [ stationary MaleConnectorDown horizontal FemaleConnectorUp ] -> [ horizontal MaleConnectorDown horizontal FemaleConnectorUp ]
+ [ vertical MaleConnectorLeft stationary FemaleConnectorRight ] -> [ vertical MaleConnectorLeft vertical FemaleConnectorRight ]
+ [ vertical MaleConnectorRight stationary FemaleConnectorLeft ] -> [ vertical MaleConnectorRight vertical FemaleConnectorLeft ]
+ [ stationary MaleConnectorLeft vertical FemaleConnectorRight ] -> [ vertical MaleConnectorLeft vertical FemaleConnectorRight ]
+ [ stationary MaleConnectorRight vertical FemaleConnectorLeft ] -> [ vertical MaleConnectorRight vertical FemaleConnectorLeft ]
( Connectors try to pull connected connectors with them )
[ up FemaleConnectorDown stationary MaleConnectorUp ] -> [ up FemaleConnectorDown up MaleConnectorUp ]
[ up MaleConnectorDown stationary FemaleConnectorUp ] -> [ up MaleConnectorDown up FemaleConnectorUp ]
[ down FemaleConnectorUp stationary MaleConnectorDown ] -> [ down FemaleConnectorUp down MaleConnectorDown ]
[ down MaleConnectorUp stationary FemaleConnectorDown ] -> [ down MaleConnectorUp down FemaleConnectorDown ]
[ left FemaleConnectorRight stationary MaleConnectorLeft ] -> [ left FemaleConnectorRight left MaleConnectorLeft ]
[ left MaleConnectorRight stationary FemaleConnectorLeft ] -> [ left MaleConnectorRight left FemaleConnectorLeft ]
[ right FemaleConnectorLeft stationary MaleConnectorRight ] -> [ right FemaleConnectorLeft right MaleConnectorRight ]
[ right MaleConnectorLeft stationary FemaleConnectorRight ] -> [ right MaleConnectorLeft right FemaleConnectorRight ]
( Try to push correctly-oriented connectors away )
(up [ > FemaleConnectorUp | stationary MaleConnectorDown ] -> [ > FemaleConnectorUp | > MaleConnectorDown ]
up [ > MaleConnectorUp | stationary FemaleConnectorDown ] -> [ > MaleConnectorUp | > FemaleConnectorDown ]
down [ > FemaleConnectorDown | stationary MaleConnectorUp ] -> [ > FemaleConnectorDown | > MaleConnectorUp ]
down [ > MaleConnectorDown | stationary FemaleConnectorUp ] -> [ > MaleConnectorDown | > FemaleConnectorUp ]
left [ > FemaleConnectorLeft | stationary MaleConnectorRight ] -> [ > FemaleConnectorLeft | > MaleConnectorRight ]
left [ > MaleConnectorLeft | stationary FemaleConnectorRight ] -> [ > MaleConnectorLeft | > FemaleConnectorRight ]
right [ > FemaleConnectorRight | stationary MaleConnectorLeft ] -> [ > FemaleConnectorRight | > MaleConnectorLeft ]
right [ > MaleConnectorRight | stationary FemaleConnectorLeft ] -> [ > MaleConnectorRight | > FemaleConnectorLeft ])
( Pushables stop against walls )
[ > Pushable | Wall ] -> [ Blocked > Pushable | Wall ]
[ orthogonal Pushable | Blocked ] -> [ Blocked orthogonal Pushable | Blocked ]
[ Blocked orthogonal Pushable ] -> [ Blocked Pushable ]
[ Blocked ] -> [ ]
( Commit movement )
[ orthogonal Ship ] -> [ action Ship ]
up [ action Ship | orthogonal AttachmentUp ] -> [ action Ship | action AttachmentUp ]
down [ action Ship | orthogonal AttachmentDown ] -> [ action Ship | action AttachmentDown ]
left [ action Ship | orthogonal AttachmentLeft ] -> [ action Ship | action AttachmentLeft ]
right [ action Ship | orthogonal AttachmentRight ] -> [ action Ship | action AttachmentRight ]
endloop
( Player stops against stopped pushables )
[ > Player | stationary Pushable ] -> [ Player | Pushable ]
( Enact committed movement on pushables )
[ orthogonal Player ] [ action Pushable ] -> [ orthogonal Player ] [ orthogonal Pushable ]
( Move fused markers with ships )
[ orthogonal Ship Fused ] -> [ orthogonal Ship orthogonal Fused ]
( Move cores with ships )
[ orthogonal Ship Core ] -> [ orthogonal Ship orthogonal Core ]
( Move colors with ships )
[ orthogonal Ship Color ] -> [ orthogonal Ship orthogonal Color ]
( Recalculate poweredness )
late [ ShipPowered no Connected ] -> [ ShipUnpowered ]
late [ ShipUnpowered Connected ] -> [ ShipPowered Connected ]
late [ FusedUpPowered no Connected ] -> [ FusedUpUnpowered ]
late [ FusedUpUnpowered Connected ] -> [ FusedUpPowered Connected ]
late [ FusedDownPowered no Connected ] -> [ FusedDownUnpowered ]
late [ FusedDownUnpowered Connected ] -> [ FusedDownPowered Connected ]
late [ FusedLeftPowered no Connected ] -> [ FusedLeftUnpowered ]
late [ FusedLeftUnpowered Connected ] -> [ FusedLeftPowered Connected ]
late [ FusedRightPowered no Connected ] -> [ FusedRightUnpowered ]
late [ FusedRightUnpowered Connected ] -> [ FusedRightPowered Connected ]
==============
WINCONDITIONS
==============
Some Connector
All Connector on Connected
=======
LEVELS
=======
▓▓▓▓▓▓▓▓▓
▓.......▓
▓..╡ṙ╞..▓
▓..▓╥▓..▓
▓.r├.┤r.▓
▓..▓┴▓..▓
▓...r...▓
▓@......▓
▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓
▓....╨.▓▓
▓...╡ṙ╞.▓
▓.┤r├║..▓
▓..r▓r..▓
▓..┬┤r├.▓
▓.......▓
▓@......▓
▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓
▓.┴.....▓
▓┤gg─ṙ╞.▓
▓.g.▓╥..▓
▓.│.....▓
▓.ġ╞.@..▓
▓.╥.....▓
▓.......▓
▓▓▓▓▓▓▓▓▓
(
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓.............▓
▓...........r.▓
▓...........r.▓
▓.....┴.....r.▓
▓.....r.....r.▓
▓...┤rrr├r....▓
▓.....r▓rrr...▓
▓.....│..r....▓
▓....@r.......▓
▓....rrr......▓
▓.....r.......▓
▓.............▓
▓.............▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
)
▓▓▓▓▓▓▓
▓rrr.▓▓
▓┬.╥..▓
▓..┴..▓
▓r├r.@▓
▓╥╡ṙ╞.▓
▓..╥..▓
▓▓...▓▓
▓▓▓▓▓▓▓
(
▓▓▓▓▓▓▓▓
▓......▓
▓.╡r←..▓
▓.╨┬.╨.▓
▓╡ṙ╞╡r├▓
▓.╥..╥.▓
▓..@...▓
▓▓▓▓▓▓▓▓
)
( Need to work out how to force putting reds together?
▓▓▓▓▓▓▓▓▓▓
▓.┴......▓
▓┤ġg╞....▓
▓.g......▓
▓.╥ṙ╞┤r┴.▓
▓......g.▓
▓.@..┤gg╞▓
▓......╥.▓
▓▓▓▓▓▓▓▓▓▓
)
▓▓▓▓▓▓▓▓▓
▓▓.....▓▓
▓.......▓
▓.┤r.ṙ╞.▓
▓.▓│@│▓.▓
▓.╡r.r├.▓
▓.......▓
▓▓.....▓▓
▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓
▓.┴....▓▓
▓╡ġg╞.@.▓
▓.┬┤ṙ╞╨.▓
▓.╨.┤gg.▓
▓.r╞....▓
▓▓.....▓▓
▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓▓▓▓
▓▓.....▓▓
▓...╨┤r.▓
▓.┴╡ṙ╞┬.▓
▓.r├╥.@.▓
▓▓..▓..▓▓
▓▓▓▓▓▓▓▓▓
( New levels )
▓▓▓▓▓▓▓▓▓
▓.......▓
▓.╨...@.▓
▓.r.r...▓
▓.r═r...▓
▓.ṙ.┬.┴.▓
▓..┤rrr.▓
▓.......▓
▓▓▓▓▓▓▓▓▓
Space Junker 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment