Skip to content

Instantly share code, notes, and snippets.

@pancelor
Created June 24, 2023 21:50
Show Gist options
  • Save pancelor/cef60a85fe78b8bd4e98799049469193 to your computer and use it in GitHub Desktop.
Save pancelor/cef60a85fe78b8bd4e98799049469193 to your computer and use it in GitHub Desktop.
WIP - i'm being eaten by a boa constrictor! (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title WIP - i'm being eaten by a boa constrictor!
author pancelor
homepage pancelor.com
text_color #c18c72
background_color #462c4b
level_select
runtime_metadata_twiddling
run_rules_on_level_start
again_interval 0.034
========
objects
========
body
#6ac0bd
.000.
00000
00000
00000
.000.
head
#6ac0bd #462c4b
.000.
00000
00000
01010
.000.
wall
#c18c72 #724254
00010
11111
01000
11111
00010
crate
#4e5e5e
00000
0...0
0...0
0...0
00000
background
#fcebb6
00000
00000
00000
00000
00000
conl
#5889a2
.....
.....
00...
.....
.....
conr
#5889a2
.....
.....
...00
.....
.....
conu
#5889a2
..0..
..0..
.....
.....
.....
cond
#5889a2
.....
.....
.....
..0..
..0..
con0
#5889a2
.....
.....
..0..
.....
.....
apple
#c18c72 #a9f05f #fcebb6
..0..
.111.
12111
11111
.111.
headdone
#5889a2 #462c4b
.000.
00000
00000
01010
.000.
bodydone
#5889a2
.000.
00000
00000
00000
.000.
spike
#4e5e5e
.....
...0.
.0.0.
.0.00
000..
mat
#c18c72
0...0
.0.0.
.....
.0.0.
0...0
_head
#a9f05f
.....
.....
.0.0.
.....
.....
_crate
#a9f05f
.....
.....
..0..
.....
.....
a_l
transparent
a_r
transparent
a_u
transparent
a_d
transparent
=======
legend
=======
player = head
. = background
# = wall
p = head
o = apple
u = body
c = crate
i = spike
; = mat
a_ = a_l or a_r or a_u or a_d (temp marker with again scope)
gcon = conl or conr or conu or cond
gdone = bodydone or headdone
gmove = crate or head
gstopby = wall or head or body or crate or gdone
gstopon = apple or spike or mat
=======
sounds
=======
crate move 36772507
endlevel 83744503
startgame 92244503
body create 19807907
body destroy 51291908
apple destroy 95401105
================
collisionlayers
================
background
mat,spike,wall
crate
apple
body,head
gdone
_head,a_
_crate
conl
conr
conu
cond
con0
======
rules
======
(hydrate)
left [conl] -> [> conl]
right [conr] -> [> conr]
up [conu] -> [> conu]
down [cond] -> [> cond]
(hydrate)
left [a_l] -> [> a_l]
right [a_r] -> [> a_r]
up [a_u] -> [> a_u]
down [a_d] -> [> a_d]
[> a_ gmove gstopon] -> [gmove gstopon]
[> a_ gmove no gstopon] -> [> gmove]
(>head | gstopby?)
[> head | crate] -> [head | > _crate] (push)
[> head | body < gcon] -> [| > _head] (retract)
[> head | gstopby] -> [head | gstopby]
[> head | no gstopby] -> [body > con0 | > _head] (spring out)
left [> con0] -> [> conl] (knit)
right [> con0] -> [> conr]
up [> con0] -> [> conu]
down [> con0] -> [> cond]
(todo [> _head gstopon] -> [head gstopon] (stopon) )
[> head] -> message err1
(> crate)
[> crate | gstopby] -> [crate | gstopby]
[> crate |] -> [| crate]
(stop-ons)
[crate spike] -> [headdone]
[head spike] -> [headdone]
[head apple] -> [headdone]
[head mat] -> [head mat]
(todo: propagate bodydone visuals (post solver))
(todo: speed up(?) solver with SLL instead of DLL for body)
(todo: speed up solver with no hydration niceties)
(cleanup)
left [> _head] -> [a_l head] again
right [> _head] -> [a_r head] again
up [> _head] -> [a_u head] again
down [> _head] -> [a_d head] again
left [> _crate] -> [a_l crate] again
right [> _crate] -> [a_r crate] again
up [> _crate] -> [a_u crate] again
down [> _crate] -> [a_d crate] again
[> gcon] -> [gcon]
[_head] -> message err2
[_crate] -> message err3
==============
winconditions
==============
no apple
=======
levels
=======
(---------)
(workspace)
(---------)
(bad)
#############
###........##
#p..........#
#...o#......#
###.##...#..#
###p;;;#o...#
###.##...#..#
#...o#......#
#p..........#
###........##
#############
(---------------)
(level stockpile)
(---------------)
##############
#####.p..#####
#####....##o.#
##..###..#o..#
##.......p..;#
##.......#..;#
##...#####.#.#
#..........###
##i###########
##############
(too much)
##############
#####.p..#####
#####....##o.#
##..###..#o..#
##.......p..;#
##.......#i..#
##.......#;.;#
##...#####.#.#
#..........###
##i###########
##############
(nice)
#############
#####.p..####
#####....####
##ii###..#o.#
##.......p..#
##.......#.;#
##.......#..#
##..o#####.##
#..........##
##i##########
#############
(----------)
(unit tests)
(----------)
(should win: urlu)
#######
###o###
#op..;#
##...p#
#######
(should behaves smoothly, no gaps: u[rl]*)
######
##o###
#p;;;#
#...p#
######
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment