Skip to content

Instantly share code, notes, and snippets.

@ncrecc
Created February 7, 2021 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ncrecc/f97e7a1818f9e66daa8c9be4662b0b2d to your computer and use it in GitHub Desktop.
Save ncrecc/f97e7a1818f9e66daa8c9be4662b0b2d to your computer and use it in GitHub Desktop.
Project 5 (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Project 5
author Thinky Collective
homepage www.puzzlescript.net
(verbose_logging)
run_rules_on_level_start
( DEV LOG )
(#0 Le Slo: Created polarity mechanics between crates. all graphics are squares. Added a level.)
(#1 knexator: Added three very simple levels.)
(#2 pancelor: made placeholder graphics easier to parse visually; still placeholder tho. added swap powerup. added two levels.)
(#3 velleic: Added a simple level in the middle)
(#4 jcGyo: Fixed connected crates moving bug when the main one being pushed can't move)
(#5 Cantaloupe: Fix Swap overlap with Player bug when pushed into something which blocks it. Added two levels)
(#6 ncrecc: added, uhh, maybe more stuff than i should. added a lava/wicker mechanic, added a magnetic player mechanic, and fixed a movement bug when three same-polarity objects are in a line.)
(#7 ncrecc: added pins)
(#8 ncrecc: added 6 levels and remade the old wicker level. made it so magnetized player can consume swap blocks by pressing space while adjacent to them. probably some misc bugfixes related to fire)
(#9 ncrecc: overspecific kludge; blocks that want to repel horizontally are now checked *after* blocks that want to repel vertically, so level 8 is no longer unsolvable. also patched an unintended solution in level 16 and fixed cratesneutral not conducting heat)
(#10 Justas: Added 9 levels, some sketches and noted down some bugs.)
(#11 ncrecc: added explanations to the bugs, also removed a test level i made a while ago)
(#12 Patrick: Added 1 level, graphics for -/+ crates)
(#13 ncrecc: made player graphics, swap graphics, and crateneutral graphics. also changed some layering so things look nicer (swaps now render in front of targets; inactive pins now render below the player because they look weird on top of their eyes))
========
OBJECTS
========
Background
GREEN
Target
transparent DarkBlue
00000
01110
01010
01110
00000
Wall
BROWN
PlayerNeutral
Black Orange #FF9335 #DB7E2E
.222.
22111
20101
11113
.313.
CrateNeutral \ (use sparingly)
Orange #FF9335 #DB7E2E
11112
10220
12220
12220
20000
CrateMinus (feel free to change)
#1A485E #153B4C black #4790AD #3F819B
00001
03330
03441
03441
01122
CratePlus (feel free to change)
white #FFD1D1 #FFBFBF #FF7575 #FF5959
10112
13332
13442
23442
12222
Swap
Black #153B4C #1A485E White #FFD1D1 #FFBFBF
.....
.33..
.452.
..10.
.....
LevelBound
DARKGREY
PlayerMinus (feel free to change also)
Blue #153B4C #1A485E Black #4790AD #3F819B
.221.
12212
24151
11113
.313.
PlayerPlus (feel free to change also)
Red #FF5959 #FF7575 White #FFD1D1 #FFBFBF
.445.
44552
53231
22211
.111.
TempHorizontal
#ff00ff
.....
.....
00000
.....
.....
TempVertical
#ff00ff
..0..
..0..
..0..
..0..
..0..
Lava
Red Orange
00011
01100
10001
00110
11000
Flame
Yellow Orange
..0..
0.000
00100
01110
.010.
Wicker
Darkbrown
00000
0.0.0
00.00
0.0.0
00000
PinInactive (any crates/wicker on this will be immobile. active/inactive is purely visual cue to demonstrate it won't pin down the player)
Purple Darkblue
.....
.0.0.
.....
.0.0.
.....
PinActive
Pink
.....
.0.0.
.....
.0.0.
.....
=======
LEGEND
=======
player = PlayerNeutral or PlayerMinus or PlayerPlus
. = Background
, = LevelBound
# = Wall
P = PlayerNeutral
q = PlayerNeutral and Target
O = Target
* = CratePlus
@ = CrateMinus
% = Swap
! = CratePlus and Target
$ = CrateMinus and Target
& = Swap and Target
b = PlayerMinus
d = PlayerPlus
+ = Lava
x = Wicker
: = PinInactive
; = PinActive and Wicker
? = Swap and Wall
" = PinActive and CrateMinus
/ = CrateNeutral and Lava and PinActive
Crate = CrateMinus or CratePlus or CrateNeutral or Wicker
Pushable = Crate or Swap
BlocksMovement = Crate or Wall
Minus = CrateMinus or PlayerMinus
Plus = CratePlus or PlayerPlus
Temp = TempHorizontal or TempVertical
Flammable = Swap or Player or Wicker
HeatConductor = CrateMinus or CratePlus or CrateNeutral (the crates are steel. the player is organic. magnetic players (player-, player+) are either organic magnets (???), beings with steel skin and non-steel vital organs, or robots that explode in high heat)
Pin = PinInactive or PinActive
Heavy = CrateNeutral or CrateMinus or CratePlus
Light = Wicker or Swap
=======
SOUNDS
=======
Flame create 62546102
PinActive create 55825507
PinInactive create 56452307
( 58682707 (magnet repel))
( 22599907 (push crate))
( 57745307 (push wicker))
sfx1 12191303 (swap consume)
================
COLLISIONLAYERS
================
TempHorizontal
TempVertical
Background
Lava
PinInactive
Player, Wall, Crate, LevelBound
PinActive
Target
Swap
Flame
======
RULES
======
startloop
[action PlayerPlus|Swap] -> [action PlayerMinus|] sfx1
[action PlayerMinus|Swap] -> [action PlayerPlus|] sfx1
endloop
[> Player | Wall] -> [Player | Wall]
[> Player | Pushable no Pin] -> [ > Player | > Pushable no Pin]
[> Swap | Swap no Pin] -> [> Swap | > Swap no Pin]
(Currently Swaps are able to phase through Walls, if that should not be allowed, replace LevelBound with Wall)
[> Swap | LevelBound] -> [Swap | LevelBound]
[> Swap | stationary Swap] -> [Swap | Swap]
[> Player | stationary Swap] -> [Player | Swap]
vertical [Minus|Minus|Minus] -> [Minus|Minus TempVertical|Minus]
vertical [Plus|Plus|Plus] -> [Plus|Plus TempVertical|Plus]
horizontal [Minus|Minus|Minus] -> [Minus|Minus TempHorizontal|Minus]
horizontal [Plus|Plus|Plus] -> [Plus|Plus TempHorizontal|Plus]
vertical [Minus no TempVertical | Minus no TempVertical] -> [< Minus | > Minus]
vertical [Minus TempVertical | Minus no TempVertical] -> [Minus TempVertical | > Minus]
horizontal [Minus no TempHorizontal | Minus no TempHorizontal ] -> [< Minus | > Minus]
horizontal [Minus TempHorizontal | Minus no TempHorizontal] -> [Minus TempHorizontal | > Minus]
vertical [Plus no TempVertical | Plus no TempVertical] -> [< Plus | > Plus]
vertical [Plus TempVertical | Plus no TempVertical] -> [Plus TempVertical | > Plus]
horizontal [Plus no TempHorizontal | Plus no TempHorizontal] -> [< Plus | > Plus]
horizontal [Plus TempHorizontal | Plus no TempHorizontal] -> [Plus TempHorizontal | > Plus]
[> Crate Pin] -> [Crate Pin]
[> Crate | Crate no Pin] -> [> Crate | > Crate no Pin]
[> Crate | stationary BlocksMovement] -> [Crate | BlocksMovement]
[moving Minus | stationary Plus] -> [moving Minus | moving Plus]
+[moving Plus | stationary Minus] -> [moving Plus | moving Minus]
[> Crate | Crate no Pin] -> [> Crate | > Crate no Pin] (kludge for wicker/cratesneutral being pushed by connected magnet blocks)
[> Crate | stationary BlocksMovement] -> [Crate | BlocksMovement] (aaa)
[Flame stationary HeatConductor Lava] -> [action Flame stationary HeatConductor Lava]
[Flame moving HeatConductor Lava] -> [moving Flame moving HeatConductor Lava]
[stationary Flame stationary HeatConductor|moving Flame] -> [action Flame HeatConductor|moving Flame]
[stationary Flame] -> []
[> Crate Pin] -> [Crate Pin]
(if you uncomment this bit it should make it so that any magnets attracted to a magnet that's stuck on a pin, or any magnets attracted to *those* magnets, and so on, will be immobile. however it doesn't really line up with how magnets aren't rigid otherwise, e.g. if a magnet attached to a magnet makes a move that results in its attachment moving into a wall, that doesn't cancel the magnet's move, it just separates the magnets.)
(
[CratePlus Pin] -> [action CratePlus Pin]
[CrateMinus Pin] -> [action CrateMinus Pin]
startloop
[action CrateMinus|CratePlus] -> [action CrateMinus|action CratePlus]
[action CratePlus|CrateMinus] -> [action CratePlus|action CrateMinus]
endloop
)
late [CratePlus Swap] -> [CrateMinus] sfx1
late [CrateMinus Swap] -> [CratePlus] sfx1
late [PlayerPlus Swap] -> [PlayerMinus] sfx1 (how would this even happen?)
late [PlayerMinus Swap] -> [PlayerPlus] sfx1
late[Minus | Minus] -> again
late[Plus | Plus] -> again
late [Flammable Lava] -> [Flame Lava]
late [HeatConductor Lava] -> [HeatConductor Flame Lava]
startloop
late [Flame|Flammable] -> [Flame|Flame]
late [Flame|HeatConductor] -> [Flame|HeatConductor Flame]
endloop
late [Flame] -> again
late [no Background] -> [Background]
late [Temp] -> []
late [Crate PinInactive] -> [Crate PinActive]
late [PinActive no Crate] -> [PinInactive]
==============
WINCONDITIONS
==============
no Wicker
All Flame on HeatConductor (kludge; don't win until everything flammable is finished burning)
some Player
All Target on Crate
=======
LEVELS
=======
(Le Slo)
############
#####p.#####
#*###..###@#
#..........#
#o#..@*..#o#
###......###
############
(knexator)
####..
#.o#..
#..###
#!p..#
#..@.#
#..###
####..
(knexator)
####..
#.o#..
#..###
#!p..#
#..*.#
#..###
####..
(velleic)
#####..
#.oo#..
##.*###
#...*p#
#*...##
#o..##.
#####..
(knexator)
........
..@..*..
...oo...
...oo...
..p..@..
.*......
(pancelor)
.#####..
.#...###
##@..*o#
#...@p##
#..o###.
#.o.#...
#####...
(Justas, 2021-02-05)
..p..
..@*.
.....
o#$#o
(Justas, 2021-02-05)
(fishing?)
..oo...
...o...
.*.$.*.
...p...
@@@@@@@
(Justas, 2021-02-05)
.....#
p@.$o$
.....#
.....#
(Justas, 2021-02-05)
(the infinite loop forces a move to be made last. please abuse this c:)
######
p@.@o$
.#####
......
###o@.
(Justas, 2021-02-05)
.#@#.#@#.
..o...o..
.........
.........
..@.p.@..
.........
..@.@.@..
.........
.........
(Justas, 2021-02-05)
..#@#@#..
..#o#.#..
..#@#@#..
..#.#o#..
..#@#@#..
.........
..@...@..
.........
..@...@..
.........
....p....
.........
.........
(Patrick, 2021-02-06)
*...#####
o....####
.*.*..###
.......##
.*.p.*..#
.........
#..*.*.*.
##.......
###..*.*.
####....o
#####...*
(Justas, 2021-02-05)
..#@#@#..
..#o#o#..
..#@#@#..
.........
..@...@..
.........
..@...@..
.........
..@...@..
.........
...p.*...
.........
.........
(pancelor)
###..
#o###
#.$.#
#@..#
#..p#
#%.##
#..#.
####.
(Cantaloupe)
########
###....#
###*.p.#
###@#..#
###*#%.#
#o.o.o.#
########
(Cantaloupe)
(is this message intended for the player? -Justas)
message requires Swap can phase through Wall
,,,,,,,,,
,#######,
,#....o#,
,#.#*#.#,
,#.#$#.#,
,#.###.#,
,#.p%%.#,
,#.....#,
,#######,
,,,,,,,,,
(Justas, 2021-02-05)
##@####
##.####
##@####
p@...*o
.##@###
.....##
.%.%.##
.....##
(ncrecc)
##########
#::::::::#
#:.....q:#
#:.::::::#
#:......:#
#::::::.:#
#:@.....:#
#::::::::#
##########
(ncrecc)
#########
#..:::::#
#..:...:#
#.@:@:."#
#p...:..o
#.@:@:.:#
#..:...:#
#..:::::#
#########
(ncrecc)
message "Oh no, lava! My only weakness!"
message "Well, that and my poor grasp on the laws of thermodynamics."
,#+++++++++
,#++..o.+++
##+.......+
+++...o...+
p@...@+.@.+
+++...o...+
##+++++++++
(ncrecc)
message "Who left this firewood laying around?"
#######
##.p.##
##$.$##
#.....#
#..x..#
#.....#
#..+..#
#######
(ncrecc)
,######
,#....#
##.@..#
#.x:xp#
#..@..#
++..;.#
+++...#
+++####
message "I have to push the magnets!"
message "No, PlayerNeutral, you are the magnets."
message And then PlayerMinus was a magnet.
(ncrecc)
#########
#.......#
#...b...#
#.@.o.@.#
#.o.@.o.#
#.......#
#########
(Justas, 2021-02-05)
b...##
.@.$o$
.....#
.....#
(ncrecc)
message "Hm, I wonder if I can still reach for those swap blocks..."
message (Press SPACE to consume adjacent swap blocks)
(this one's a little boring)
###?????###
#....:....#
?..*.+.ob.?
?.*.o+*.o.?
#....:....#
###?????###
(ncrecc; test)
(
########
#x..p..#
#..*...#
#...:..#
#..@.@.#
#......#
#...@.@#
########
)
(Some sketches. Pick these up if you've got an idea!)
(inf loop, push down)
(
......p..
......@..
.........
....@*@..
...oooo..
....@....
)
(
..........
..........
.....oooo#
..p@.@*.*#
..........
..........
..........
)
(press right, interesting)
(
..........o
...........
...........
...........
...........
...@.".....
.p@*.......
...........
...........
...........
...........
)
(
.............
.............
..o..........
.............
.....p*@.@...
..........@..
.......*%@...
.............
.............
.............
)
(================bugs====================)
message "Bugs and quirks start here! Please read the comments."
(Bug -- press up (Justas 2021-02-05))
(ncrecc: replace the blue pinned magnet with a wall and the same bug still occurs. this is because the whole magnet chain moves upward without considering whether any of its magnets will become deattached)
.o......
........
........
..."....
..@*@*..
....p...
(Bug -- press up, nothing happens (Justas 2021-02-05))
(ncrecc: player tries to push the magnet up but the other magnet repels it and forces it to move horizontally.)
......
.o....
.#@@#.
...p..
......
(Bug -- looping lots in a rule group, press down (Justas 2021-02-05))
(ncrecc: game can't decide whether the wicker should move down, because there's a magnet pushing downward on it, or left, because there's a magnet being repelled and pushing left on it. could be fixed by just adding an "is this crate stationary" check to line 245)
.......
..p....
..@..o.
.#x$@#.
...###.
.......
(Ambiguous -- Push any of the blues. The resulting layout is asymmetrical (Justas 2021-02-05))
(ncrecc: the magnets above and below the 3rd target both try to go into the same space, but both magnets can't be in the same tile, so just one of the magnets gets in and the other magnet does not move.)
.............
.............
.............
......@......
.....@.@.....
...p@ooo@....
.....@.@.....
......@......
.............
.............
.............
(Ambiguous -- press down. Which of the blues should move? (Justas 2021-02-05))
(ncrecc: the players move, and then the engine checks each tile to see if the rules should make it react. it happens to notice that the magnet on the target should be repelled before it notices the magnet between the players should be pushed)
....o
.p...
.@...
.q$@#
..###
.....
(Bug -- press down (Justas 2021-02-05))
(ncrecc: i don't see any bug here? it's already established that magnets don't get blocked from moving just because one of the magnets they're attached to can't move in that direction.)
oo.....
.......
.......
..p....
..*@...
...*...
@@@@@@@
(Bug -- press left. Why is the red moving? (Justas 2021-02-05))
(ncrecc: same bug as the first bug, basically. the red magnet decides it's attracted to the top non-pinned blue magnet, and moves in the same direction as it, but doesn't notice that magnet is moving against the player and is blocked.)
o......
..".@p.
...@*..
.......
.......
(bug: moving down doesn't cause the same thing to happen in both situations (ncrecc 2021-02-07))
o......
.......
...db..
.....@.
...*...
.......
o......
....p..
...*@..
.....@.
...*...
.......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment