Skip to content

Instantly share code, notes, and snippets.

@Draknek
Created October 12, 2024 15:09
Show Gist options
  • Save Draknek/c538fb555314e37f455078c190644132 to your computer and use it in GitHub Desktop.
Save Draknek/c538fb555314e37f455078c190644132 to your computer and use it in GitHub Desktop.
Construction site prototype
https://puzzlescriptnext.polyomino.com/editor.html
title Construction site prototype
author Alan Hazelden
homepage https://alan.draknek.org/
//tween_length 0.1
again_interval 0.1
run_rules_on_level_start
noaction
level_select
level_select_solve_symbol ✓
// enable one-line comments
========
OBJECTS
========
Background
#000
Floor
#666 #444 #777
00000
00000
00200
00000
00000
11111
11111
11111
translate:down:9
ShortWall
#888 #444 #888
20002
00000
00000
00000
20002
11111
11111
11111
11111
11111
11111
translate:down:9
TallWall
#ccc #444
00000
00000
00000
00000
00000
11111
11111
11111
11111
11111
11111
11111
11111
11111
translate:down:9
Destination:H1
black
.....
.000.
.0.0.
.000.
.....
translate:down:6
Player:H1
#a46422 #5e3d38 #53261f
..0..
.111.
01110
02220
.2.2.
translate:down:4
Crate:H1
#b68c5a #b68c5a #9d6a3b #9d6a3b
.001.
.011.
.111.
.223.
.223.
.223.
translate:down:5
BarrelRollsUD:H1 canvas:1,2
{"beginPath":[]}
{"fillStyle":"#c75b37"}
{"ellipse":[0.1,0.6,0.075,0.3,0,0,7]}
{"ellipse":[0.9,0.6,0.075,0.3,0,0,7]}
{"rect":[0.1,0.3,0.8,0.6]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#99462d"}
{"ellipse":[0.15,0.6,0.075,0.25,0,0,7]}
{"ellipse":[0.85,0.6,0.075,0.25,0,0,7]}
{"rect":[0.15,0.35,0.7,0.5]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#c75b37"}
{"ellipse":[0.35,0.6,0.04,0.25,0,0,7]}
{"ellipse":[0.65,0.6,0.04,0.25,0,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#99462d"}
{"ellipse":[0.4,0.6,0.04,0.25,0,0,7]}
{"ellipse":[0.6,0.6,0.04,0.25,0,0,7]}
{"fill":[]}
{"closePath":[]}
translate:down:9
BarrelRollsLR:H1 canvas:1,2
{"beginPath":[]}
{"fillStyle":"#c75b37"}
{"arc":[0.5,0.3,0.3,0,7]}
{"rect":[0.2,0.3,0.6,0.6]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#a54b31"}
{"arc":[0.5,0.3,0.25,0,7]}
{"rect":[0.25,0.35,0.5,0.5]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#c75b37"}
{"arc":[0.5,0.45,0.25,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#a54b31"}
{"arc":[0.5,0.5,0.25,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#c75b37"}
{"arc":[0.5,0.65,0.25,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#a54b31"}
{"arc":[0.5,0.7,0.25,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#c75b37"}
{"arc":[0.5,0.9,0.3,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#99462d"}
{"arc":[0.5,0.9,0.25,0,7]}
{"fill":[]}
{"closePath":[]}
translate:down:9
BarrelUpright:H1 canvas:1,2
{"beginPath":[]}
{"fillStyle":"#c75b37"}
{"arc":[0.5,0.9,0.3,0,7]}
{"rect":[0.2,0.3,0.6,0.6]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#99462d"}
{"arc":[0.5,0.9,0.25,0,7]}
{"rect":[0.25,0.35,0.5,0.5]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#c75b37"}
{"arc":[0.5,0.75,0.25,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#99462d"}
{"arc":[0.5,0.7,0.25,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#c75b37"}
{"arc":[0.5,0.55,0.25,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#99462d"}
{"arc":[0.5,0.5,0.25,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#c75b37"}
{"arc":[0.5,0.3,0.3,0,7]}
{"fill":[]}
{"closePath":[]}
{"beginPath":[]}
{"fillStyle":"#a54b31"}
{"arc":[0.5,0.3,0.25,0,7]}
{"fill":[]}
{"closePath":[]}
translate:down:9
Falling:H1
transparent
ElevatorToggle
transparent
ElevatorDown
#294973 #999 #444
00000
01110
01110
01110
00000
22222
22222
22222
translate:down:9
ElevatorUp
#294973 #999 #444 #222 #555
00000
01110
01110
01110
00000
22222
43334
43334
44444
22222
22222
translate:down:9
// height 0 objects
Player:H0
#a46422 #5e3d38 #53261f
copy: Player:H1 translate:down:3
Crate:H0
#b68c5a #b68c5a #9d6a3b #9d6a3b
copy: Crate:H1 translate:down:3
// height 2 objects
Player:H2
#a46422 #5e3d38 #53261f
copy: Player:H1 translate:up:3
Crate:H2
#b68c5a #b68c5a #9d6a3b #9d6a3b
copy: Crate:H1 translate:up:3
Falling:H2
transparent
Destination:H2
black
copy: Destination:H1 translate:up:3
// gfx
FloorBorder:up:H1
#7a7163 transparent transparent
00000
12221
.....
.....
.....
translate:down:6
FloorBorder:directions:H1
#7a7163 transparent transparent
copy: FloorBorder:up:H1 rot:up:directions
FloorBorderCorner:up:H1
#7a7163
0....
.....
.....
.....
.....
translate:down:6
FloorBorderCorner:directions:H1
#7a7163
copy: FloorBorderCorner:up:H1 rot:up:directions
FloorBorder:directions:H2
#b4a692 transparent #808080
copy: FloorBorder:directions:H1 translate:up:3
FloorBorderCorner:up:H2
#b4a692
0....
.....
.....
.....
.....
translate:down:3
FloorBorderCorner:directions:H2
#b4a692
copy: FloorBorderCorner:up:H2 rot:up:directions
====
TAGS
====
H = H0 H1 H2
H_1or2 = H1 H2
dir_lru = left right up
// can't get mappings to work, I'll just do it manually
(Habove = H1
========
MAPPINGS
========
Habove => Hbelow
H1 -> H0)
=======
LEGEND
=======
. = Floor
P = Player:H1 and Floor
Q = Player:H2 and ShortWall
S = Floor
T = ShortWall
$ = ShortWall
# = TallWall
* = Crate:H1 and Floor
@ = Crate:H2 and ShortWall
_ = Background
1 = Destination:H1 and Floor
2 = Destination:H2 and ShortWall
A = ElevatorDown
B = ElevatorUp
C = BarrelRollsLR:H1 and Floor
D = BarrelRollsUD:H1 and Floor
E = BarrelUpright:H1 and Floor
Wall:H2 = TallWall
Wall:H1 = Wall:H2 or ShortWall or ElevatorUp
Wall:H0 = Wall:H1 or Floor or ElevatorDown
Barrel:H1 = BarrelRollsUD:H1 or BarrelRollsLR:H1 or BarrelUpright:H1
SomeFloor = Wall:H0
MovingSolid:H0 = Player:H0 or Crate:H0
MovingSolid:H1 = Player:H1 or Crate:H1
MovingSolid:H2 = Player:H2 or Crate:H2
Solid:H0 = Wall:H0 or Player:H0 or Crate:H0
Solid:H1 = Wall:H1 or Player:H1 or Crate:H1
Solid:H2 = Wall:H2 or Player:H2 or Crate:H2
Standable:H1 = Floor or ElevatorDown or Player:H0 or Crate:H0
Standable:H2 = ShortWall or ElevatorUp or Player:H1 or Crate:H1
Player = Player:H0 or Player:H1 or Player:H2
AnyDestination = Destination:H1 or Destination:H2
Something:H0 = Player:H0 or Crate:H0
Something:H1 = Player:H1 or Crate:H1
Something:H2 = Player:H2 or Crate:H2
Shadows = FloorBorder:directions:H_1or2
=======
SOUNDS
=======
EndLevel 17718708
Restart 50986909
Undo 88249507
sfx0 74542309 //enter/leaving slime
sfx1 73903506 // elevator
sfx2 26349706 // elevator
sfx3 16928507 // moving
Falling:H1 Destroy 28221907
Falling:H2 Destroy 28221907
Player:H0 Create 93238702
================
COLLISIONLAYERS
================
Background
---
Floor, ShortWall, TallWall, ElevatorDown, ElevatorUp
directions -> FloorBorderCorner:directions:H_1or2
directions -> FloorBorder:directions:H_1or2
Player:H0, Crate:H0
Destination:H1
Player:H1, Crate:H1, Barrel:H1
Destination:H2
Player:H2, Crate:H2
ElevatorToggle
Falling:H1
Falling:H2
======
RULES
======
[ moving Player:H0 ] -> cancel
[ moving Player:H ] -> sfx3
// avoid falling into holes unnecessarily
[ > Player:H1 | no Standable:H1 ] -> [ Player:H1 | ]
[ > Player:H2 | no Standable:H1 no Standable:H2 ] -> [ Player:H2 | ]
// pushing
H [ > Player:H | Crate:H ] -> [ > Player:H | > Crate:H ]
H [ > Crate:H | Crate:H ] -> [ > Crate:H | > Crate:H ]
H [ > Solid:H | stationary Solid:H ] -> [ Solid:H | Solid:H ]
H [ action Solid:H ] -> [ Solid:H ]
// actually move things
H [ > Solid:H | no Solid:H ] -> [ | Solid:H ]
// do elevators
[ ElevatorUp ElevatorToggle ] -> [ ElevatorDown ] sfx2
[ ElevatorDown ElevatorToggle ] -> [ action ElevatorDown ]
[ action ElevatorDown Something:H1 ] -> [ action ElevatorDown action Something:H1 ]
[ ElevatorDown action MovingSolid:H1 MovingSolid:H2 ] -> [ ElevatorDown MovingSolid:H1 MovingSolid:H2 ] // cancel if there's a crate on a crate on the elevator
[ action ElevatorDown stationary Something:H1 ] -> [ ElevatorDown Something:H1 ] // cancel elevator movement
[ action MovingSolid:H1 no MovingSolid:H2 ] -> [ MovingSolid:H2 ]
[ action ElevatorDown ] -> [ ElevatorUp ] sfx1
// do falling
[ Falling:H2 Player:H2 ] -> [ Falling:H2 Player:H1 ]
[ Falling:H2 Crate:H2 ] -> [ Falling:H2 Crate:H1 ]
[ Falling:H2 ] -> []
[ Falling:H1 Player:H1 ] -> [ Falling:H1 Player:H0 ]
[ Falling:H1 Crate:H1 ] -> [ Falling:H1 Crate:H0 ]
[ Falling:H1 ] -> []
// elevators check
[ ElevatorDown Something:H1 ] -> [ ElevatorDown Something:H1 ElevatorToggle ] again
[ ElevatorUp no Something:H2 ] -> [ ElevatorUp ElevatorToggle ] again
// falling check
[ Player:H2 no Standable:H2 ] -> [ Player:H2 Falling:H2 ]
[ Crate:H2 no Standable:H2 ] -> [ Crate:H2 Falling:H2 ]
[ Falling:H2 ] -> again
[ Player:H1 no Standable:H1 ] -> [ Player:H1 Falling:H1 ]
[ Crate:H1 no Standable:H1 ] -> [ Crate:H1 Falling:H1 ]
[ Falling:H1 ] -> again
// shadow gfx
(up [ Floor | Wall:H1 no ElevatorUp ] -> [ Floor FloorBorder:up:H1 | Wall:H1 ]
up [ ShortWall | Wall:H2 ] -> [ ShortWall FloorBorder:up:H2 | Wall:H2 ]
left [ Floor | Wall:H1 no ElevatorUp ] -> [ Floor FloorBorder:left:H1 | Wall:H1 ]
left [ ShortWall | Wall:H2 ] -> [ ShortWall FloorBorder:left:H2 | Wall:H2 ]
right [ Floor | Wall:H1 no ElevatorUp ] -> [ Floor FloorBorder:right:H1 | Wall:H1 ]
right [ ShortWall | Wall:H2 ] -> [ ShortWall FloorBorder:right:H2 | Wall:H2 ])
[ Floor | no Floor no ElevatorDown no ElevatorUp ] -> [ Floor FloorBorder:>:H1 | ]
[ ShortWall | no ShortWall ] -> [ ShortWall FloorBorder:>:H2 | ]
[ Floor no FloorBorder:>:H1 no FloorBorder:^:H1 | FloorBorder:^:H1 ] -> [ Floor FloorBorderCorner:>:H1 | FloorBorder:^:H1 ]
[ ShortWall no FloorBorder:>:H2 no FloorBorder:^:H2 | FloorBorder:^:H2 ] -> [ ShortWall FloorBorderCorner:>:H2 | FloorBorder:^:H2 ]
==============
WINCONDITIONS
==============
All Player on AnyDestination
=======
LEVELS
=======
//// PART 1: slimes ////
// todo: easier first level
section Level A1
__p_________
_...________
_.s.________
_..._.._____
_____s._..._
_..s____...1
_.s.____..._
_...________
____________
____________
(hint level
__p_________
_...________
_..s________
_..._.._____
_____s._..._
__s.____...1
__..____..._
__.s________
__..________
____________
____________
)
// todo: introduce multipush
// todo: introduce walls (but put them places where you can't push against them
// todo: introduce bigger slimes, without ability to go inside
section Level A2
_____________
_____________
____..._...__
____.$._ss.__
____..._ss.__
_____________
..._____...__
.1._____ps.__
..._____...__
_____________
_____________
section Level A3
// Level design: Lucas Le Slo
____.....$$$$1$$
___......$$$...$
___s...ss$$$...$
___..p...$$$...$
____.ss..$$$__.$
____....._____.$
____.$$$$_______
________________
________________
section Level A4
_______##q##.1
_______#$$$#__
__######t$t#._
__#.ss.#$$$#._
__#.ss._...___
__#...._______
______________
______________
//// PART 2: elevators ////
section Level B1
####p####
####a####
#.....ss#
#s....ss#
#.....ss#
#.sss...#
#.sss...#
#.......#
#######$#
____.....
____1____
_________
// todo: more elevator levels without crates
section Level B2
____#####_________
____$###$_____..._
____$$$$$_____...1
____$ttt$_____..._
____$ttt$_____$.$_
____$$$$$_____..._
____a...s_____..._
____..p.._____..._
____....._________
__________________
__________________
section Level B3
_____________________
__.............______
_....a.........._____
_..p.....$ttt$.._____
_.....a..$ttt$a._____
_........$ttt$.._____
_..tt________________
_.att________________
_....______..._______
___________.1._______
___________..._______
_____________________
_____________________
section Level B4
// Level design: Lucas Le Slo
_##1##___________
_#...#___________
_#.$.#...._______
_#...#.p$$tssa___
_#___#..$t$ss.___
_#...........____
_________________
_________________
//// PART 3: crates ////
// todo: introduce crates
section Level C1
_____#######______
###2###$$$##______
###$###$#@##______
##$$$##$$@#####___
##$$$##..$#####___
##$$$......$tt$___
___...pa$..$tt$___
________$$$$$$$___
__________________
__________________
section Level C2
($$$$$#____________
$...$########_____
$.s.$..#...$#_____
$.s.$..*..a$######
$...$$$$$.$$..$$$#
$.p...........$2$#
$$$_________..$$$#
__________________
__________________
__________________
$$$$$#___________
$...$########____
$.s.$..#..a$#____
$.s.$..*..$$#####
$...$$$$$....$$$#
$.p..........$2$#
$$$__________$$$#
_________________
_________________
_________________
__________________
____.s.$$$$$$_____
____.s.$..a.$_____
____.p......$_____
__...__$$.$$$_____
__.*.______....___
__..........__$$$_
______________$2$_
______________$$$_
__________________
__________________
___...$$$$$$$_____
___.s.....a.$_____
___.s.$.*...$_____
___...$$$.$$$_____
___.p...___....___
_______.....__$$$_
______________$2$_
______________$$$_
__________________
__________________
__...$$$$$$$$_____
__.s...$..a.$_____
__.s.$.*....$_____
__...$$$$.$$$_____
__.p....___....___
_______.....__$$$_
______________$2$_
______________$$$_
__________________
_______________
__...$$$_$$$___
__.s.$.a_..$___
__.s.$..*..$___
__...$.$$$$$___
__.p.___....___
__.......__$$$_
___________$2$_
___________$$$_
_______________
________________
__...########___
__.p.$...#..$___
__...$a..*..$___
__.s.$$.$$$$$___
__.s.____....___
__........__$$$_
____________$2$_
____________$$$_
________________
________________
______#######___
______$..#..$___
__.p.$$..*..$___
__.s.$a.$$$$$___
__.s.........___
_____.....__$$$_
____________$2$_
____________$$$_
________________
_______________
_____#######___
_____$..#..$___
__...$..*..$___
__.sa$.$$$$$___
__.s........___
_____.p.___$$$_
___________$2$_
___________$$$_
_______________)
_______________
_____#######___
_____$..#..$___
_____$..*..$___
__..a$.$$..$___
__.p....$$$$___
__....s.....___
_____.s.___$$$_
___________$2$_
___________$$$_
_______________
section Level C3
$$1$$$$$$$$p$$$
$...$___......$
$...$___.....*$
$...$___..ss..$
$_______..ss..$
$_______......$
$_______......$
$$$$$$$$$$$$$$$
section Level C4
#######2#
#####...#
$$.#.ss.#
$$*#ass##
$$......$
$.......$
$..$$$..p
$$$$$$$$$
section Level C5
// Level design: Lucas Le Slo
_#####___________
_#...$___________
_#...$____$______
_#...#.ss.@..a.__
_#...#.ss......__
_1...#......p..__
_________________
_________________
//// PART 4: and now for a little bit of everything ////
section Level D1
###########2#
####.......$#
####........#
#ttt..$..#$$#
#ttt.$$..##$#
#$$$a$...$$$#
#....@..._$$#
#....$_.@____
_______p_____
_____________
_____________
section Level D2
$$1$$$$$$$$$$$$
$...$___......$
$...$___......$
$...$___..ss..$
$___$___..ss..p
$...$___..ss..$
$....___.....*$
$....___......$
$$$$$$$$$$$$$$$
section Level D3
______#######
______#$$$..#
______#$$$a.#
______#$$$..#
______..s...#
______....ss#
______..s.ss#
______$$$####
_$$$__$q$$$$#
_$2$__$$$$$$#
_$$$_________
_____________
section Level D4
##q##2########
#$$$#$########
#$$$#.########
#$@t$.########
#$$$#.$$$$$###
#####..a..$s$$
####......*s.$
#tt#..$$..$s$$
#tt$$$$$..$$$$
##$$$$$$______
section Level D5
$$1$$$$$$$$$$$$
$...$$$_______$
$...$$$_______$
$___$$$__...*.$
$___$$$__.ss..$
$...$$$__.ss..$
$....____.....p
$...._________$
$...$$$_______$
$$$$$$$$$$$$$$$
section Level D6
##1########_____
#...______#_____
#...______a.____
#..._____.*..___
_________.a..___
________.ssp.___
________.ss..___
_________...____
________________
________________
section Level D7
____#######_____
___$$...sss.____
___$#...sss.____
___$@.a.sss.____
____.....p..____
________________
________________
________$$$_____
________$#$_____
________$$$_____
_________2______
message Thanks for playing :)
// WIP levels
(
#2##q######
$$$#$$$$..#
...#$$$$..#
$$$#$@t$..#
...#####..#
$$$#..ss..#
......ss..#
......$$..#
.....a$$..#
___________
___________
___________
__$$$$$____
__$.a$$____
__$s.$$_...
__$as.__.1.
__$.p___...
___________
___________
___________
____________
____________
__$$$$$_____
__$.a$q$____
__$s.$$$_...
__$as..__.1.
__$_.____...
____________
____________
____________
___________
___________
__$$$$$____
__$.a$$____
__$s.$$_...
__$as.__.1.
__$p.___...
___________
___________
___________
___$$$p$$$$$1$$$_
___$s...s$_..._$_
___$s...s$_..._$_
___$.....$_..._$_
___$...ss$_____$_
_________________
_________________
_________________
_________________
_________________
........$$$.$2__
...ss...$$$.$$__
...ss.........._
......p........_
..............._
...$$$$........_
...$tt$.$$$...._
...$tt$.$$$...._
...$$$$a$$$...._
________________
)
// slime on top of slime on top of elevator - blocks elevator
// crate on top of crate on top of elevator - blocks elevator
// crate on top of slime - then elevator pushes slime up so crate is in slime
// cut levels
(
______########
______.#######
______*..#####
______.a.....#
______...sss.#
______...sss.#
_$$$__.......#
2$#$___...p..#
_$$$__####.###
################_
#$$$....ttt....$_
#$t$....ttt....2_
#$$$....ttt....$_
#.a......a.______
#.....p....______
#..........______
_________________
)
// bugs
(##################
#...*..ss........#
#sss...ss.ss*ss..#
#sss...ss*ss.ssp.#
#...ss.ss.ss.ss..#
#...ss.ss........#
#................#
##################)
// fixed bugs
(
___...........2
___............
___.p.ss.s.___.
___............
_______________
_______________
#####2########
#............#
#............#
#............#
#..p.s.*.*...#
#............$
#............$
#............$
#............$
#_____________
##########
#....#.s.#
#....*.s.#
#......sp#
#......s.#
#....s.s.#
#....#.s.#
##########
)
// testcases
(
###############
####........###
####.*.p..#.###
#.....*.s.....#
#..ss...s.....#
#..ss....ss...#
#.............#
###############
##################
#................#
#....p*......$...#
#.$.s....*.s...$.#
#......s.........#
#...........*....#
#................#
##################
##################
#.____...........#
#.____.ss...*....#
#.._ss.ss*.....p.#
#...ss.ss..s.....#
#................#
#................#
##################
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment