Created
January 31, 2024 21:17
-
-
Save ssteinbach/8fda568e85dd8f24f60bc00361547e92 to your computer and use it in GitHub Desktop.
Shifter Test (PuzzleScript Script)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title Shifter Test | |
author jade and stephan | |
homepage www.puzzlescript.net | |
======== | |
OBJECTS | |
======== | |
Background | |
gray | |
Target | |
yellow | |
.000. | |
0...0 | |
0.0.0 | |
0...0 | |
.000. | |
Wall | |
black | |
Player | |
blue black | |
.000. | |
01010 | |
10001 | |
.000. | |
00.00 | |
Crate | |
brown | |
Crate_One | |
darkbrown | |
Crate_Zero | |
darkblue | |
GreenKey | |
green | |
.0... | |
0.000 | |
.0..0 | |
..... | |
..... | |
GreenDoorClosed | |
black green | |
..... | |
.010. | |
01010 | |
10101 | |
01010 | |
GreenDoorOpen | |
green | |
..... | |
.000. | |
0...0 | |
0...0 | |
0...0 | |
( Line of sight) | |
losV (Visible areas) | |
transparent | |
losD (Dark / nonvisible areas) | |
black | |
======= | |
LEGEND | |
======= | |
. = Background | |
# = Wall | |
P = Player | |
* = Crate | |
@ = Crate and Target | |
C = Crate_One | |
X = Crate_Zero | |
O = Target | |
g = GreenKey | |
t = GreenDoorClosed | |
b = GreenDoorOpen | |
(things that are opaque to visibility) | |
losO = Wall or GreenDoorClosed or Crate | |
======= | |
SOUNDS | |
======= | |
================ | |
COLLISIONLAYERS | |
================ | |
Background | |
( overlappable things ) | |
GreenKey, GreenDoorOpen | |
( things the player bumps into ) | |
Player, Wall, Crate, Crate_One, Crate_Zero, GreenDoorClosed | |
losV | |
losD | |
Target | |
====== | |
RULES | |
====== | |
( basic pushing rules ) | |
[ > Player | Crate_One ] -> [ > Player | > Crate_Zero ] | |
[ > Player | Crate ] -> [ > Player | > Crate_One ] | |
( lock / key mechanics ) | |
late [ Player GreenKey ] [ GreenDoorClosed ] -> [ Player GreenKey ] [ GreenDoorOpen ] | |
late [ Player GreenKey ] -> [Player] | |
(visibility stuff) | |
( | |
ghost no left_ray]->[ghost left_ray] | |
left [left_ray | no wall no player] -> [ | left_ray] | |
left [left_ray | wall]->[ | wall] | |
left [left_ray | player]->[right_response_ray | player] | |
right [right_response_ray | no wall no player] -> [ | right_response_ray] | |
right [right_response_ray | stationary ghost]->[ | left ghost] | |
[right_response_ray]->[] | |
) | |
( LINE OF SIGHT ) | |
(---------------) | |
( Lift darkness ) | |
late [ losD ] -> [ ] | |
( Create a 3x3 area of visibility around player ) | |
late [ P | ] -> [ P losV | losV ] | |
late [ no losV | losV | no losV ] -> [ losV | losV | losV ] | |
( Deleted backgrounds are used to mark the edges of visible area when extending it. ) | |
( losD is used here as a temporary marker for blocks that are visible, but from which visibility is not extended. ) | |
( Extend visibility to 5x5 "circle") | |
late [ losV Background losO no losD | no losV ] -> [ losV Background losO | no Background losD ] | |
late [ losV Background no losO no losD | no losV ] -> [ losV Background | losV no Background ] | |
late [ no Background ] -> [ Background ] | |
(7x7, three squares away) | |
late [ losV Background losO no losD | no losV ] -> [ losV Background losO | no Background losD ] | |
late [ losV Background no losO no losD | no losV ] -> [ losV Background | losV no Background ] | |
late [ no Background ] -> [ Background ] | |
(9x9, four squares away ) | |
late [ losV Background losO no losD | no losV ] -> [ losV Background losO | no Background losD ] | |
late [ losV Background no losO no losD | no losV ] -> [ losV Background | losV no Background ] | |
late [ no Background ] -> [ Background ] | |
( Player can sometimes see through opaque blocks sideways, fix that ) | |
late [ Player | losO | losV ] -> [ Player | losO | no losV ] | |
late [ Player | | losO | losV ] -> [ Player | | losO | no losV ] | |
late [ Player | losO | | losV ] -> [ Player | losO | | no losV ] | |
( Extend visibility to the sides of visible blocks on each side ) | |
late [ Player | | losV ] -> [ Player | no Background | no Background losV ] (for 5x5) | |
late [ Player | | | losV ] -> [ Player | no Background | no Background | no Background losV ] (for 7x7) | |
late [ Player | | | | losV ] -> [ Player | no Background | no Background | no Background | no Background losV ] (for 9x9) | |
late [ Background | losV no Background | Background ] -> [ losV Background | losV no Background | losV Background ] | |
late [ no Background ] -> [ Background ] | |
( Cover everything that is not visible to darkness ) | |
late [ ] -> [ losD ] | |
late [ losV ] -> [ no losD ] | |
============== | |
WINCONDITIONS | |
============== | |
all Player on Target | |
======= | |
LEVELS | |
======= | |
(level 1) | |
############### | |
##########*..O# | |
##...*..*.**..# | |
##...*..*.*.*.# | |
##...*..*.**..# | |
##************# | |
##...*...*..*.# | |
##.*.*.P.*.*..# | |
##...*...*.*..# | |
##.*******.*..# | |
##.*..*.......# | |
##.*..********# | |
##.*..*.......# | |
############### | |
############### | |
(level 2) | |
############### | |
############### | |
##.O.*..*.**.## | |
##...*..*****## | |
##..***.*.**.## | |
##***********## | |
##...*...*...## | |
##.*.*.*.*...## | |
##..**.*.*...## | |
##*******..*.## | |
##....*......## | |
##.*..*******## | |
##.*...**...P## | |
############### | |
############### | |
(level 3) | |
############### | |
############### | |
##...*..*.*.*## | |
##.*.*.O.*.*.## | |
##..***.*.*.*## | |
##t**********## | |
##.......*...## | |
##.....*.*.g.## | |
##..*******..## | |
##*******..**## | |
##..*.*.**...## | |
##.**.*.*.***## | |
##.*..*P*....## | |
############### | |
############### | |
(original tests | |
(test level) | |
######### | |
#....t.O# | |
#....t..# | |
#....ttt# | |
#..g....# | |
#P......# | |
######### | |
######### | |
#..*.*.O# | |
#..*..*.# | |
#**.**..# | |
#..*.*..# | |
#P.*.*..# | |
######### | |
######### | |
#..*.*.O# | |
#C.*..*.# | |
#**.**.*# | |
#.**.*..# | |
#P.*..**# | |
######### | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment