Skip to content

Instantly share code, notes, and snippets.

Created October 4, 2014 00:07
Show Gist options
  • Save anonymous/b5874dbdf349f9daf4b9 to your computer and use it in GitHub Desktop.
Save anonymous/b5874dbdf349f9daf4b9 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 Reflection game
author Alan Hazelden
homepage www.draknek.org
norepeat_action
(verbose_logging)
========
OBJECTS
========
Background
white yellow
11111
01111
11101
11111
10111
Target
DarkBlue
.....
.000.
.0.0.
.000.
.....
Wall
BROWN DARKBROWN
00010
11111
01000
11111
00010
Hole
lightblue blue
11111
11101
11111
10111
11111
Player
#a46422 #493c2b #000000
..0..
.111.
01110
02220
.2.2.
Reflection
LightGrey Grey DarkGrey
..0..
.111.
01110
02220
.2.2.
Crate
Orange Brown
.000.
01110
01110
01110
.000.
CrateInHole
Brown DarkBrown Blue
20002
01110
01110
01110
20002
MirrorUL
#909090 #4e5159 #4e5159
....0
...01
..011
.0111
01112
MirrorUR
#909090 #4e5159 #4e5159
0....
10...
110..
1110.
21110
MirrorDL
#909090 #4e5159 #4e5159
01112
.0111
..011
...01
....0
MirrorDR
#909090 #4e5159 #4e5159
21110
1110.
110..
10...
0....
LOS
Orange
.....
.....
..0..
.....
.....
0
transparent
1
transparent
2
transparent
3
transparent
4
transparent
5
transparent
6
transparent
7
transparent
8
transparent
9
transparent
HasReflection
transparent
A
transparent
B
transparent
C
transparent
D
transparent
=======
LEGEND
=======
. = Background
# = Wall
P = Player
* = Crate
O = Target
_ = Hole
Mirror = MirrorUL or MirrorUR or MirrorDL or MirrorDR
Counter = 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9
Counter2 = A or B or C or D
Pushable = Mirror or Crate
Solid = Player or Wall or Crate or Mirror
/ = MirrorUL
\ = MirrorUR
` = MirrorDL
' = MirrorDR
=======
SOUNDS
=======
Crate MOVE 36772507
================
COLLISIONLAYERS
================
Background
Target, Hole, CrateInHole
HasReflection
Solid, LOS
Reflection
Counter
Counter2
======
RULES
======
(Swap places)
[ action Player HasReflection ] [ Reflection ] -> [ action Player HasReflection ] [ Reflection Player ]
[ Reflection Player ] -> [ Player ]
[ action Player HasReflection ] -> [ Reflection ]
(Clear state)
[ LOS ] -> []
[ HasReflection ] -> []
[ Reflection ] -> []
[ action Player ] -> [ Player ]
[ moving Player ] -> [ moving Player HasReflection ] (testing killing)
(Push things)
[ > Player | Hole ] -> [ Player | Hole ]
[ > Player | Crate ] -> [ > Player | > Crate ]
[ > Player | Mirror ] -> [ > Player | > Mirror ]
[ > Pushable | no Solid ] -> [ | Pushable ]
+ [ > Player | no Solid ] -> [ | Player ]
[ > Player ] -> [ Player ]
[ Player Hole ] -> [ Hole ]
[ Mirror Hole ] -> cancel
[ Crate Hole ] -> [ CrateInHole ]
[ Player ] [ HasReflection ] -> [ Player ] []
[ HasReflection ] -> cancel (all players dead)
(Make reflections)
startloop
random [ Player no Counter2 ] -> [ action Player A left 0 ]
+ [ Player A ] -> [ action Player B right 0 ]
+ [ Player B ] -> [ action Player C up 0 ]
+ [ Player C ] -> [ action Player D down 0 ]
[ > 0 | no Solid ] -> [ | > 1 LOS ]
[ > 1 | no Solid ] -> [ | > 2 LOS ]
[ > 2 | no Solid ] -> [ | > 3 LOS ]
[ > 3 | no Solid ] -> [ | > 4 LOS ]
[ > 4 | no Solid ] -> [ | > 5 LOS ]
[ > 5 | no Solid ] -> [ | > 6 LOS ]
[ > 6 | no Solid ] -> [ | > 7 LOS ]
[ > 7 | no Solid ] -> [ | > 8 LOS ]
[ > 8 | no Solid ] -> [ | > 9 LOS ]
[ > Counter | Solid no Mirror ] -> [ | Solid ]
left [ > Counter | MirrorUR ] -> [ | MirrorUR up Counter ]
+ left [ > Counter | MirrorDR ] -> [ | MirrorDR down Counter ]
+ right [ > Counter | MirrorUL ] -> [ | MirrorUL up Counter ]
+ right [ > Counter | MirrorDL ] -> [ | MirrorDL down Counter ]
+ up [ > Counter | MirrorDL ] -> [ | MirrorDL left Counter ]
+ up [ > Counter | MirrorDR ] -> [ | MirrorDR right Counter ]
+ down [ > Counter | MirrorUL ] -> [ | MirrorUL left Counter ]
+ down [ > Counter | MirrorUR ] -> [ | MirrorUR right Counter ]
+ [ > 9 | no Solid ] -> [ | > 8 LOS ]
+ [ > 8 | no Solid ] -> [ | > 7 LOS ]
+ [ > 7 | no Solid ] -> [ | > 6 LOS ]
+ [ > 6 | no Solid ] -> [ | > 5 LOS ]
+ [ > 5 | no Solid ] -> [ | > 4 LOS ]
+ [ > 4 | no Solid ] -> [ | > 3 LOS ]
+ [ > 3 | no Solid ] -> [ | > 2 LOS ]
+ [ > 2 | no Solid ] -> [ | > 1 LOS ]
+ [ > 1 | no Solid ] -> [ | > 0 LOS ]
[ > 0 | no Solid ] [ action Player ] -> [ | Reflection ] [ Player HasReflection ]
[ Counter ] -> []
[ action Player ] [ stationary LOS ] -> [ action Player ] []
[ LOS ] -> [ action LOS ]
[ action Player ] -> [ Player ]
endloop
[ Counter2 ] -> []
==============
WINCONDITIONS
==============
All Target on Player
All Player on Target
=======
LEVELS
=======
_____________
___....._____
__........___
___........__
______...o.._
___..___...._
__.....__..__
__...p.._____
____...._____
__.______..__
_....__....._
_..\.._....._
_.....__...._
__...____..__
_____________
_____________
_____....____
____.p.'..___
___.......___
______.._____
___._____..__
__...___...._
__....__..o._
__....._...._
_......_...__
_..'...__.___
_......______
__...._______
___..________
_____________
_________________
________...._____
_______...*..____
__..__.......____
_....__..*...____
_....___...______
_....____________
__..___..____..._
__..__....__..o._
_.'._.....__...._
_..._..._____..__
_..._..__..______
__..____...._____
_______.*.p..____
_______....._____
_________________
________________
_..__.____._____
_......__..p____
_......_..'.____
__....._.*..____
____..___..__.__
_______._____.._
__.___..____..._
_........___.o._
__.....*.___..._
____.*...____.._
_____...________
________________
_______________
__...____...___
_..._____....__
_.o.____...*.__
_...______...._
_.._______...__
__.__..__...___
__._../....____
____..._.._____
____.p.________
_____..________
_______________
________________
_________...____
________.....___
__..____..*..___
_....____...____
_.....___.._____
_..o..______..._
__....____...*._
__...___...__.._
___..__.p.______
_______...._..._
_________../..._
__________....__
________________
____________
____..__..__
___...._..._
___.'.._..._
___...__.o._
___..__...._
__...__..o._
__.p.__...._
__...__..o._
__...___..._
_.\..___..__
_...._______
__..________
____________
(______________
______________
______________
______________
______________
______________
______________
______________
______________
______________
______________)
message Thanks for playing :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment