Skip to content

Instantly share code, notes, and snippets.

@ryansalexander
Created June 5, 2018 15:19
Show Gist options
  • Save ryansalexander/9662f2b60a750561e980d5ad6c7829ee to your computer and use it in GitHub Desktop.
Save ryansalexander/9662f2b60a750561e980d5ad6c7829ee 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 Lasers [main branch]
author Aaron Williams
(#NOTE: The following line is commented to make level design easier; remember to uncomment it before giving the game to players. And maybe also add realtime_interval here and remove the "again" markers in the Rules section. Because that would also make gameplay smoother, but make level design much more difficult.)
(run_rules_on_level_start)
========
OBJECTS
========
Background
Black
Wall
DarkGray
00000
00.00
0...0
00.00
00000
Exit
Brown LightBrown
.0.0.
.010.
.0.0.
.010.
.0.0.
LaserU
LightBlue Red Gray White
2.3.2
2.3.2
23332
11111
.101.
LaserD
LightBlue Red Gray White
.101.
11111
23332
2.3.2
2.3.2
LaserL
LightBlue Red Gray White
2221.
..311
33310
..311
2221.
LaserR
LightBlue Red Gray White
.1222
113..
01333
113..
.1222
LaserOffU
Blue Red Gray White
2...2
20002
20002
11111
.101.
LaserOffD
Blue Red Gray White
.101.
11111
20002
20002
2...2
LaserOffL
Blue Red Gray White
2221.
.0011
.0010
.0011
2221.
LaserOffR
Blue Red Gray White
.1222
1100.
0100.
1100.
.1222
LaserOnU
LightBlue Red Gray White Orange
2.3.2
24342
23332
11111
.141.
LaserOnD
LightBlue Red Gray White Orange
.141.
11111
23332
24342
2.3.2
LaserOnL
LightBlue Red Gray White Orange
2221.
.4311
33314
.4311
2221.
LaserOnR
LightBlue Red Gray White Orange
.1222
1134.
41333
1134.
.1222
BeamU
White
..0..
..0..
..0..
..0..
..0..
BeamD
White
..0..
..0..
..0..
..0..
..0..
BeamL
White
.....
.....
00000
.....
.....
BeamR
White
.....
.....
00000
.....
.....
StableBeamU
White
..0..
..0..
..0..
.....
.....
StableBeamD
White
.....
.....
..0..
..0..
..0..
StableBeamL
White
.....
.....
000..
.....
.....
StableBeamR
White
.....
.....
..000
.....
.....
MirrorUL
DarkGray LightGray
....1
...10
..100
.1000
10000
MirrorUR
DarkGray LightGray
1....
01...
001..
0001.
00001
MirrorDR
DarkGray LightGray
00001
0001.
001..
01...
1....
MirrorDL
DarkGray LightGray
10000
.1000
..100
...10
....1
GoalOff
Green
.....
.000.
.0.0.
.000.
.....
GoalOn
LightGreen
.....
.000.
.0.0.
.000.
.....
GuardU
DarkGray
00000
.....
.....
.....
.....
GuardD
DarkGray
.....
.....
.....
.....
00000
GuardL
DarkGray
0....
0....
0....
0....
0....
GuardR
DarkGray
....0
....0
....0
....0
....0
Glass
LightBlue
00000
0.0.0
00..0
0...0
00000
Splitter1
Lightgray
....0
...0.
..0..
.0...
0....
Splitter2
Lightgray
0....
.0...
..0..
...0.
....0
PlayerEmpty
Gray
..0..
.000.
0.0.0
.0.0.
.0.0.
PlayerCarrying
Gray
0.0.0
.000.
..0..
.0.0.
.0.0.
Crate
Brown
00000
0...0
0...0
0...0
00000
WireOff
Blue
.....
.000.
.000.
.000.
.....
WireOn
Orange
.....
.000.
.000.
.000.
.....
ButtonOff
DarkGray DarkRed
00.00
01110
.111.
01110
00.00
ButtonOn
DarkGray Red
00.00
01110
.111.
01110
00.00
DoorClosed
Gray Blue
00000
01110
01110
01110
00000
DoorOpen
DarkBrown Orange
.000.
01110
01110
01110
.000.
AntiDoorClosed
Gray Orange
00000
01110
01110
01110
00000
AntiDoorOpen
DarkBrown Blue
.000.
01110
01110
01110
.000.
(An AND gate. Takes inputs from opposite sides; outputs to a wire on a third side)
Gate0
DarkGray Blue Orange
.000.
01100
01010
00110
.000.
Gate1
DarkGray Blue Orange
.000.
02200
02010
00110
.000.
Gate2
DarkGray Blue Orange
.000.
02200
02020
00220
.000.
Translator
Pink
0...0
.....
.....
.....
0...0
Rotator
Yellow
0...0
.....
.....
.....
0...0
=======
LEGEND
=======
(Map tiles)
. = Background
# = Wall
P = PlayerEmpty
Player = PlayerEmpty or PlayerCarrying
* = Crate and Translator
! = Exit
% = Glass
W = LaserU
S = LaserD
A = LaserL
D = LaserR
I = LaserOffU
K = LaserOffD
J = LaserOffL
L = LaserOffR
¨ = LaserU and Rotator
ø = LaserD and Rotator
≥ = LaserL and Rotator
µ = LaserR and Rotator
 = LaserU and Translator
 = LaserD and Translator
Ô = LaserL and Translator
Ò = LaserR and Translator
ˆ = LaserOffU and Rotator
˚ = LaserOffD and Rotator
∆ = LaserOffL and Rotator
¬ = LaserOffR and Rotator
Q = MirrorUL
E = MirrorUR
C = MirrorDR
Z = MirrorDL
œ = MirrorUL and Translator
´ = MirrorUR and Translator
ç = MirrorDR and Translator
Ω = MirrorDL and Translator
∑ = MirrorUL and Rotator
ß = MirrorUR and Rotator
å = MirrorDR and Rotator
≈ = MirrorDL and Rotator
R = Splitter1
Y = Splitter2
® = Splitter1 and Translator
¥ = Splitter2 and Translator
‰ = Splitter1 and Rotator
Á = Splitter2 and Rotator
T = GoalOff and GuardD and GuardL and GuardR
G = GoalOff and GuardU and GuardL and GuardR
F = GoalOff and GuardU and GuardD and GuardR
H = GoalOff and GuardU and GuardD and GuardL
B = GoalOff
+ = WireOff
@ = WireOff and Wall
_ = ButtonOff
$ = DoorClosed
› = AntiDoorOpen
& = Gate0
(Laser-related groups)
LaserConstant = LaserU or LaserD or LaserL or LaserR
LaserOn = LaserOnU or LaserOnD or LaserOnL or LaserOnR
LaserOff = LaserOffU or LaserOffD or LaserOffL or LaserOffR
Laser = LaserConstant or LaserOn or LaserOff
Mirror = MirrorUL or MirrorUR or MirrorDR or MirrorDL
Splitter = Splitter1 or Splitter2
Beam = BeamU or BeamD or BeamL or BeamR
StableBeam = StableBeamU or StableBeamD or StableBeamL or StableBeamR
Goal = GoalOn or GoalOff
Guard = GuardU or GuardD or GuardL or GuardR
LightU = LaserU or LaserOnU or BeamU or StableBeamU
LightD = LaserD or LaserOnD or BeamD or StableBeamD
LightL = LaserL or LaserOnL or BeamL or StableBeamL
LightR = LaserR or LaserOnR or BeamR or StableBeamR
MirrorU = MirrorUL or MirrorUR
MirrorD = MirrorDL or MirrorDR
MirrorL = MirrorUL or MirrorDL
MirrorR = MirrorUR or MirrorDR
Opaque = Wall or Crate or DoorClosed or AntiDoorClosed
OpaqueU = Opaque or MirrorDL or MirrorDR or GuardU
OpaqueD = Opaque or MirrorUL or MirrorUR or GuardD
OpaqueL = Opaque or MirrorUR or MirrorDR or GuardL
OpaqueR = Opaque or MirrorUL or MirrorDL or GuardR
(Wire-related groups)
Wire = WireOn or WireOff
Button = ButtonOn or ButtonOff
Door = DoorOpen or DoorClosed
AntiDoor = AntiDoorOpen or AntiDoorClosed
Gate = Gate0 or Gate1 or Gate2
PowerSource = WireOn or ButtonOn or GoalOn
PowerSink = ButtonOff or Gate0 or Gate1 or GoalOff
Heavy = Player or Translator or Splitter
(Movement-related groups)
Movable = Mirror or Crate or Splitter or LaserConstant
Solid = Movable or Goal or Laser or Wall or DoorClosed or AntiDoorClosed or Guard or Glass
=======
SOUNDS
=======
(Crate MOVE 36772507)
================
COLLISIONLAYERS
================
Exit
Background
Wire
Button
Gate
DoorOpen, AntiDoorOpen
BeamU
BeamD
BeamL
BeamR
StableBeamU
StableBeamD
StableBeamL
StableBeamR
GuardU
GuardD
GuardL
GuardR
Crate, Mirror, Goal, Laser, Splitter
Translator, Rotator
Player, Wall, DoorClosed, AntiDoorClosed, Glass
======
RULES
======
(Handle player actions + movement)
[action PlayerEmpty Translator Movable] -> [PlayerCarrying Translator Movable]
[> PlayerCarrying Translator Movable | no Solid] -> [> PlayerCarrying > Translator > Movable | ]
[> Mirror StableBeam] -> [> Mirror no StableBeam]
[> Splitter StableBeam] -> [> Splitter no StableBeam]
[> PlayerCarrying | Solid] -> [PlayerCarrying | Solid]
[action PlayerCarrying] -> [PlayerEmpty]
[action Player Rotator MirrorUL] -> [Player Rotator MirrorUR]
[action Player Rotator MirrorUR] -> [Player Rotator MirrorDR]
[action Player Rotator MirrorDR] -> [Player Rotator MirrorDL]
[action Player Rotator MirrorDL] -> [Player Rotator MirrorUL]
[action Player Rotator Splitter1] -> [Player Rotator Splitter2]
[action Player Rotator Splitter2] -> [Player Rotator Splitter1]
[action Player Rotator LaserU] -> [Player Rotator LaserR]
[action Player Rotator LaserR] -> [Player Rotator LaserD]
[action Player Rotator LaserD] -> [Player Rotator LaserL]
[action Player Rotator LaserL] -> [Player Rotator LaserU]
[action Player Rotator LaserOffU] -> [Player Rotator LaserOffR]
[action Player Rotator LaserOffR] -> [Player Rotator LaserOffD]
[action Player Rotator LaserOffD] -> [Player Rotator LaserOffL]
[action Player Rotator LaserOffL] -> [Player Rotator LaserOffU]
[action Player Rotator LaserOnU] -> [Player Rotator LaserOnR]
[action Player Rotator LaserOnR] -> [Player Rotator LaserOnD]
[action Player Rotator LaserOnD] -> [Player Rotator LaserOnL]
[action Player Rotator LaserOnL] -> [Player Rotator LaserOnU]
(Handle wires)
(turn off unpowered wires)
late [ButtonOn no Heavy] -> [ButtonOff]
late [PowerSink | WireOn] -> [PowerSink | WireOff]
late [WireOff | WireOn] -> [WireOff | WireOff]
(turn on powered wires)
late [ButtonOff Heavy] -> [ButtonOn Heavy]
late [no Wire no PowerSource | Gate2 | WireOff] -> [ | Gate2 | WireOn]
late [PowerSource | WireOff] -> [PowerSource | WireOn]
(activate doors)
(late [WireOn Door] -> [WireOn DoorOpen]
late [WireOff Door no Heavy] -> [WireOff DoorClosed]
late [WireOn AntiDoor no Heavy] -> [WireOn AntiDoorClosed]
late [WireOff AntiDoor] -> [WireOff AntiDoorOpen])
late [Door no Heavy] -> [DoorClosed]
late [PowerSource | Door] -> [PowerSource | DoorOpen]
late [AntiDoor] -> [AntiDoorOpen]
late [PowerSource | AntiDoor no Heavy] -> [PowerSource | AntiDoorClosed]
(activate AND gates)
late [Gate] -> [Gate0]
late [PowerSource | Gate] -> [PowerSource | Gate1] again
late [PowerSource | Gate | PowerSource] -> [PowerSource | Gate2 | PowerSource] again
(activate lasers)
late [LaserOnU] -> [LaserOffU]
late [LaserOnD] -> [LaserOffD]
late [LaserOnL] -> [LaserOffL]
late [LaserOnR] -> [LaserOffR]
late [PowerSource | LaserOffU] -> [PowerSource | LaserOnU]
late [PowerSource | LaserOffD] -> [PowerSource | LaserOnD]
late [PowerSource | LaserOffL] -> [PowerSource | LaserOnL]
late [PowerSource | LaserOffR] -> [PowerSource | LaserOnR]
(Handle lasers)
startLoop
(Propagate beams)
late Up [LightU no OpaqueU | no OpaqueD] -> [LightU | BeamU]
late Down [LightD no OpaqueD | no OpaqueU] -> [LightD | BeamD]
late Left [LightL no OpaqueL | no OpaqueR] -> [LightL | BeamL]
late Right [LightR no OpaqueR | no OpaqueL] -> [LightR | BeamR]
(Remove blocked beams)
late Up [no LightU | BeamU] -> [ | ] (No beam/laser below)
late Up [OpaqueU | BeamU] -> [OpaqueU | ] (Top of tile below blocked)
late Up [OpaqueD BeamU] -> [OpaqueD] (Bottom of this tile blocked)
late Down [no LightD | BeamD] -> [ | ]
late Down [OpaqueD | BeamD] -> [OpaqueD | ]
late Down [OpaqueU BeamD] -> [OpaqueU]
late Left [no LightL | BeamL] -> [ | ]
late Left [OpaqueL | BeamL] -> [OpaqueL | ]
late Left [OpaqueR BeamL] -> [OpaqueR]
late Right [no LightR | BeamR] -> [ | ]
late Right [OpaqueR | BeamR] -> [OpaqueR | ]
late Right [OpaqueL BeamR] -> [OpaqueL]
(Handle mirrors)
late [MirrorUL BeamR] -> [MirrorUL BeamR StableBeamU] (Crate reflected beam)
late [MirrorUL BeamD] -> [MirrorUL BeamD StableBeamL]
late [MirrorUL no BeamR] -> [MirrorUL no LightU] (Remove when no incident beam)
late [MirrorUL no BeamD] -> [MirrorUL no LightL]
late [MirrorUR BeamL] -> [MirrorUR BeamL StableBeamU]
late [MirrorUR BeamD] -> [MirrorUR BeamD StableBeamR]
late [MirrorUR no BeamL] -> [MirrorUR no LightU]
late [MirrorUR no BeamD] -> [MirrorUR no LightR]
late [MirrorDR BeamL] -> [MirrorDR BeamL StableBeamD]
late [MirrorDR BeamU] -> [MirrorDR BeamU StableBeamR]
late [MirrorDR no BeamL] -> [MirrorDR no LightD]
late [MirrorDR no BeamU] -> [MirrorDR no LightR]
late [MirrorDL BeamR] -> [MirrorDL BeamR StableBeamD]
late [MirrorDL BeamU] -> [MirrorDL BeamU StableBeamL]
late [MirrorDL no BeamR] -> [MirrorDL no LightD]
late [MirrorDL no BeamU] -> [MirrorDL no LightL]
(Handle splitters)
late [Splitter1 BeamU] -> [Splitter1 BeamU StableBeamR]
late [Splitter1 no BeamU] -> [Splitter1 no StableBeamR]
late [Splitter1 BeamD] -> [Splitter1 BeamD StableBeamL]
late [Splitter1 no BeamD] -> [Splitter1 no StableBeamL]
late [Splitter1 BeamL] -> [Splitter1 BeamL StableBeamD]
late [Splitter1 no BeamL] -> [Splitter1 no StableBeamD]
late [Splitter1 BeamR] -> [Splitter1 BeamR StableBeamU]
late [Splitter1 no BeamR] -> [Splitter1 no StableBeamU]
late [Splitter2 BeamU] -> [Splitter2 BeamU StableBeamL]
late [Splitter2 no BeamU] -> [Splitter2 no StableBeamL]
late [Splitter2 BeamD] -> [Splitter2 BeamD StableBeamR]
late [Splitter2 no BeamD] -> [Splitter2 no StableBeamR]
late [Splitter2 BeamL] -> [Splitter2 BeamL StableBeamU]
late [Splitter2 no BeamL] -> [Splitter2 no StableBeamU]
late [Splitter2 BeamR] -> [Splitter2 BeamR StableBeamD]
late [Splitter2 no BeamR] -> [Splitter2 no StableBeamD]
endLoop
late [GoalOn no Beam] -> [GoalOff] again
late [GoalOff Beam] -> [GoalOn Beam] again
==============
WINCONDITIONS
==============
All Player on Exit
=======
LEVELS
=======
(Wires through walls need to be presented more clearly I think)
message Teaching Wires
################
#d..ß..##....$.!
#............+##
#......##....+##
#......##....+##
p...t++@@+++++##
################
(Mostly trying to see if I can make something complex and interesting)
message Experiment
#@@@@@@@@###
#@.....%+.ô#
#@.....%+..#
#@..h..%_z.#
#@..+..%...#
#@..+..%...#
#@..+..%...#
#@##@##c.≈##
#@..+......#
#@..+......#
!›$+&......#
##..+......#
##..h..ø...#
##.........#
######p#####
(Trying to make something complex with just a few mechanics)
message Complex with no interactable mirrors
...##@@@@@@@++++++++++.
...#.+....##.........+.
...#.+....##.........+.
...#.+.g++@#.........+.
...#g&g...@#.........+.
...#......@##########@#
####.c...z@@@@@@@@@@#@#
#.c....q.e...b...z.@#@#
#.....ez.c........f@#@#
p....e...¨...q.....›.$!
#.e.ø............ø.z###
#......e...........q###
#######################
message Teaching passable objects
.........#####..
.........#_..#..
.........#+..#..
.........#+..#..
##########+..###
p......$+++...$!
#_.....#......+#
#+.....#......+#
#+.....c...*..f#
#+l....q...*...#
################
message Toying around
#################
p.....f........$!
#.....+........+#
#.....&++++....+#
#.....+...+....+#
#.....f...+....+#
#.........&+++++#
#.....f...+.....#
#.....+...+.....#
#.....&++++.....#
#ô....+.........#
#.....g.........#
#ò..............#
#.´´ç.â........#
#################
message First Steps
message Press X to rotate yellow-cornered tiles
#########
#.≈..z.$!
#......@#
#......@#
p.µ..t+@#
#########
message Have Mirror, Will Travel
message Press X to pick up and carry pink-cornered tiles
#########
p.s..g+@#
#......@#
#.œ....@#
#.e....$!
#########
message Crate Expectations
#########
#.g+++.$!
#....&+@#
#.*..+.##
p.w.._.##
#########
message Feedback
#########
#......$!
#......@#
#..._..+#
p...+..+#
#...+..+#
#.d.$..f#
#...++++#
#########
message A Mess
#########
#gk.s.k+#
#......+#
#.ß..∑.+#
p..å..å+#
#≈..å..+#
#∑...ß.+#
#∑.....f#
###t$####
####!####
message Weighted Mirror Cube
####p####
#..ç.f.##
#....&+@#
#+++++.@#
#_.´.a.$!
#########
message Clear as Mud
##@@@@@@@#
#.g.$...›!
#...#.*.##
#.≈.%..a##
p...#...##
##########
message Only Half a Mirror
##g######
p.+....##
#.+....##
h&+.á.a##
#+.+++.##
#+++¥&+$!
####t@###
message Logic Gates
###################
#*_...*_...*......#
#.&+$..++$._+.+$..#
#*_...*_...d›.f...#
p.................!
#*_.s...*_..._...$#
#.&+›.$.d›.f.+l›.f#
#*_.ef+.*_.$.l.f..#
###################
message D-type Flip-Flop
###############
p..#d.y.....z.#
#..#..$.....›.#
#*_@+++++++++.#
#..#..........#
#..#..t&+++&t.#
#._@l..+.f.+.g#
#..#...++h.+›j#
#..#...+d›.f.w#
#..#...+++....#
##$@++++......#
##!############
message Toggle Latch
###############
p.#.c.r.....rz#
#.#...›.....$.#
#.#g+++++++++.#
#.#...........#
#.#...t&+++&t.#
#.#.y›.+.f.+..#
#.#..+c++b.+›y#
#.#..+.+d›.bz.#
#_@+++.+++....#
#.#.$.........#
#.#...t&+++&t.#
#.#.e..+.f.+.b#
#.#....++h.+›j#
#.#i...+d›.f.w#
#›@+++++++....#
#!#############
message Full Adder
################
p...*..*..*.$.$!
#..._.._.._.@#@#
####@##@##@#@#@#
#...+..++.+.g.g#
#...+l.z+.+....#
#h&++r.j+.+....#
#.+.+›.›+.+....#
#.+.......+....#
#.+..t+t..+....#
#++++.+...+....#
#+..+.+l.z+....#
#+.h&++r.j+....#
#+....+›.›+....#
#+.............#
#+.....t+t.....#
#+......+......#
#l......+...q..#
#.......l.....q#
################
message Tripwire
#############
p._++k.._..$!
#....+..+..@#
#.*..+..&++@#
#....t+++..##
#############
message Tripwire2
###############
p._..k..$.s..$!
#.&+++..@....@#
#.+´.+..@....@#
#._..t++@.*.f@#
###############
message Beamlock
##@@@#######
p.k.g.s..¥$!
#.........@#
#...e...z.@#
#.........@#
#.......q.@#
#.....´...@#
#...t.....@#
####@@@@@@@#
message Beamlock2
########
p..s..$!
#....´@@
#..ω.f#@
#....+#@
#l...&@@
#+...+##
#++t++##
########
message Talos
########################
p..ç´¥¥...$.....#.....##
#.........@.....#.....##
#......r.f@.....#.....##
#...#.....@.....#.....##
#...#c.%..$..a..#.._..##
#...#.....#.....#..+..##
#...#.....#.....$..&++$!
#...#.....#.....@..+..##
#...#.....%....f@.._..##
#...#t....#.....#.....##
#...#@@$###.....#.....##
#........a#.....#.....##
#.........#.....#.....##
########################
message Locks and Keys
####@@@@@@@######
p...@...#.+....$!
#._+$._+$._+++.@#
#...#...@....&+@#
#.*.####@+_+*+.##
#...#...#..&++.##
#._+$.*.#._+...##
#...#...#......##
#################
message Locks and Keys 2
######################
p.....k..#..........##
#*_++++..#....++_+++##
#.....&++$....+....+##
#.....+..#....+....+##
#*_..+&++@+++.+._+&+##
#.l..+..b%..+.+.j.+.##
#....+...$++&.+...&+$!
#.l..+..b%..+.+.j.+.##
#*_.++&++@++&++._+&+##
#...+.+..#...+.....+##
#..++.&++$...+.....+##
#*_+h.+..%...+.j_+++##
#.....b..%...j......##
######################
message Parity
############
........p.$!
#.........@#
#.≈.∑.å.≈.f#
#.........##
#.∑.ß.ß.≈.##
#.........##
#.å...ß.≈.a#
#.........##
#.∑.ß.ß.ß.##
#.........##
############
message Parity 2
################
p......s......$!
#.............@#
#..∑.å.≈.å.≈..@#
#.............@#
#..å.å.∑.ß.ß..@#
#++++++.++++++@#
#h.∑.ß&++ß.e.a##
#.....+.......##
#..å.∑+≈.≈.≈..##
#.....+.......##
#..ß.å+ß.≈.∑..##
#.....+.......##
#.....+t......##
################
message One Way
##################
p...#...#...#.._$!
#...#...$_..#...##
#._.#._.#...#...##
##$###$###$###$###
#...#...#._.#._.##
#.._$...#.._$...##
#...#._.#...#...##
######$###$#######
#...#...#._.#...##
#...#.._$...#...##
#...#...#...#...##
##################
message Hodor
##########
p.......$!
#.*...*.@#
#.......@#
#...####@#
#...#...@#
#.._$._+@#
#...#...##
##########
message Hodor 2
########
p.....##
#.....##
#.*.*.$!
#.....@#
#.....@#
###›##@#
#..+..@#
#..+..@#
#.._++@#
#.....##
#.....##
########
message Sandbox
##################
p.............._$!
#...............##
#...............##
#...............##
#...............##
#...............##
#...............##
#...............##
#...............##
#...............##
#...............##
#...............##
#...............##
##################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment