Skip to content

Instantly share code, notes, and snippets.

@david-crespo
Created April 16, 2023 16:23
Show Gist options
  • Save david-crespo/46e44c3fc524ad2fdfcc14bea8f2fbe7 to your computer and use it in GitHub Desktop.
Save david-crespo/46e44c3fc524ad2fdfcc14bea8f2fbe7 to your computer and use it in GitHub Desktop.
Light Lines (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Light Lines
author David Crespo
homepage www.puzzlescript.net
( debug )
========
OBJECTS
========
Background
#672577
00000
00000
00000
00000
00000
Wire
gray blue
.010.
00100
11111
00100
.010.
LiveWire
gray blue lightblue
.010.
00100
11211
00100
.010.
LitWire
gray lightblue
.010.
00100
11111
00100
.010.
Player
orange blue yellow
00200
.222.
21112
.111.
.1.1.
Light
gray darkgray
00100
01110
11111
01110
00100
LitLight
gray white
00100
01110
11111
01110
00100
=======
LEGEND
=======
. = Background
P = Player
O = Light
* = LitLight
+ = Wire
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
Player, Light, LitLight, Wire, LiveWire, LitWire
======
RULES
======
( Everything wants to be off )
[ LitLight ] -> [ Light ]
[ LitWire ] -> [ Wire ]
[ LiveWire ] -> [ Wire ]
( wires are pushable, up to 3 at a time )
[ > Player | Wire ] -> [ > Player | > Wire ]
( can push 2 )
( I don't understand why this works for LiveWire and LitWire too)
[ > Player | Wire | Wire ] -> [ > Player | > Wire | > Wire ]
( don't need this message if there's a dedicated level for it )
( [ > Player | Wire | Wire | Wire ] -> [ Player | Wire | Wire | Wire] message three wires... too heavy! )
( Loop needed to get through chains of light-wire-light-wire-light )
startloop
late [ Player | Light ] -> [ Player | LitLight ]
late [ LitLight | Light ] -> [ LitLight | LitLight ]
late [ LitLight | Wire ] -> [ LitLight | LiveWire ]
late [ LiveWire | Wire ] -> [ LiveWire | LiveWire ]
late [ LiveWire | Light ] -> [ LiveWire | LitLight ]
late [ LitWire | Light ] -> [ LitWire | LitLight ]
late [ LitWire | LiveWire | LitLight ] -> [ LitWire | LitWire | LitLight ]
( this rule causes wrong behavior in the case of LiveWires
touching LitWires but not themselves fully connected to lights.
they should stay LiveWire but become LitWire
)
( late [ LitWire | LiveWire ] -> [ LitWire | LitWire ] )
endloop
( TODO: left wire should be lit here but it's only live
...o..
..++..
.poo..
probably same solution as the below problem
)
( problem: this only works for lights on opposite sides, not two adjacent sides )
late [ LitLight | LiveWire | LitLight ] -> [ LitLight | LitWire | LitLight ]
( Ideas/Questions:
- should player touching a wire work like touching a light, or should player have to touch a light directly?
- Idea: Lights that can only be connected from certain sides: LightL, LightUR, etc.
- Trigger lights the player can light by touching, other lights can't be triggered
- Those two ideas combine well: the player can only light a light from a side with an exposed wire. That means only lights with more than one exposed wire are any use to the player for touching directly
- Separate stationary from being light or a wire? Eh, I kind of like it. Wires: you can't light them directly, and you can move them. That's it.
- What if you can only push multiple blocks if they're live or lit?
)
==============
WINCONDITIONS
==============
No Light
=======
LEVELS
=======
message light all the lights!
( touch a light )
......
.p....
......
......
..o...
......
( chain of lights )
......
....o.
.p..o.
....o.
......
......
( light two at once )
......
....o.
.p....
....o.
......
......
( a wire )
( ...... )
( ....o. )
( .p.... )
( ....o. )
( ...+.. )
( ....o. )
( a wire -- more interesting )
........
....ooo.
.p..o...
....o.+.
........
....o...
.oooo...
o.......
oooo....
( multiple wires )
......
....o.
.p..+.
......
.+..+.
....o.
......
( push two wires at the same time to get them unstuck )
........
...ooo..
..p..o..
.....o..
..o+....
..o+....
..o..o..
..oooo..
........
( can't push 3 )
........
...p....
.o......
.o.+....
.oo+....
...+..o.
......o.
...oooo.
........
( another can't push three to be cute)
........
...p....
........
.o.+++..
...+.+..
...+++..
........
......o.
........
( not a real level, shows the weirdness around ones that should be live)
( ........ )
( ...p.... )
( ....ooo. )
( .++++.o. )
( ...oo... )
( ...oo... )
( .o....o. )
( .oo.ooo. )
( ........ )
( ............. )
( .p.oooo..ooo. )
( ...o..oo.+... )
( ..+....ooo... )
( .oooo....+... )
( .o....oooo... )
( .o....+...... )
( oo.o+oo...... )
( o..o..o...... )
( o.ooo.oo..... )
( .......o..... )
( .ooo+ooo..... )
( ............. )
message nice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment