Skip to content

Instantly share code, notes, and snippets.

@ncrecc
Created February 14, 2021 21:07
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/d0fef9f8504a44ab1bc0bf27f7ef0aa7 to your computer and use it in GitHub Desktop.
Save ncrecc/d0fef9f8504a44ab1bc0bf27f7ef0aa7 to your computer and use it in GitHub Desktop.
Magnets, How Do They Work? (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Magnets, How Do They Work?
author Thinky Collective
homepage www.puzzlescript.net
(log:)
(#0 jcygo: initial version. no wincon.)
(#1 ncrecc: added a wincon, made 2 levels)
(#2 ncrecc: added metal, made 2 levels and some sketches)
(#3 ncrecc: added a sketch)
========
OBJECTS
========
Background
LIGHTGREEN GREEN
11111
01111
11101
11111
10111
Wall
BROWN DARKBROWN
00010
11111
01000
11111
00010
Player
Black Orange White Purple Blue
.000.
.111.
22222
.333.
.3.3.
MagnetUp
red blue grey
00000
00000
22222
11111
11111
MagnetDown
blue red grey
00000
00000
22222
11111
11111
Goal
Yellow Gray
00000
01110
01110
01100
01110
Metal
lightgray white
01110
11100
10000
10000
00001
=======
LEGEND
=======
. = Background
# = Wall
P = Player
^ = MagnetUp
v = MagnetDown
g = goal
* = Metal
Magnets = MagnetUp or MagnetDown
=======
SOUNDS
=======
Magnets MOVE 36772507
================
COLLISIONLAYERS
================
Background
Goal
Player, Wall, Magnets, Metal
======
RULES
======
(
todo!
a magnet which hits a wall on its left side should carry a "right failed" signal.
that "right failed" signal spreads to other magnets in direct contact with it.
the "right failed" signal denotes that the object moving right has hit an object and failed to move.
magnets use their right filed signal to e.g. stop a metal block from moving due to an unsuccessful magnet push.
)
[ > Player | Magnets ] -> [ > Player | > Magnets ]
startLoop
vertical [moving MagnetUp | MagnetUp] -> [moving MagnetUp | moving MagnetUp]
vertical [moving MagnetDown | MagnetDown] -> [moving MagnetDown | moving MagnetDown]
horizontal [moving MagnetUp | MagnetDown] -> [moving MagnetUp | moving MagnetDown]
horizontal [moving MagnetDown | MagnetUp] -> [moving MagnetDown | moving MagnetUp]
vertical [moving Magnets | stationary Metal] -> [moving Magnets | moving Metal]
UP [MagnetUp | MagnetDown] -> [DOWN MagnetUp | UP MagnetDown]
UP [MagnetDown | MagnetUp] -> [DOWN MagnetDown | UP MagnetUp]
RIGHT [MagnetUp | MagnetUp] -> [LEFT MagnetUp | RIGHT MagnetUp]
RIGHT [MagnetDown | MagnetDown] -> [LEFT MagnetDown | RIGHT MagnetDown]
[ > Magnets | Player] -> [ > Magnets | > Player ]
[ > Magnets | Magnets] -> [ > Magnets | > Magnets]
[ > Metal | stationary Magnets] -> [ > Metal | > Magnets]
[ > Metal | Metal] -> [ > Metal | > Metal ]
vertical [no Magnets | Metal | no Metal no Magnets | Magnets ] -> [ | > Metal | | Magnets ]
endLoop
late vertical [MagnetUp | MagnetDown] -> [MagnetUp | MagnetDown] again
late horizontal [MagnetUp | MagnetUp] -> [MagnetUp | MagnetUp ] again
late horizontal [MagnetDown | MagnetDown] -> [MagnetDown | MagnetDown] again
late vertical [Magnets | | Metal] -> [Magnets | | Metal ] again
==============
WINCONDITIONS
==============
All Player on Goal
=======
LEVELS
=======
(
(jcygo)
########g##
##^.......#
#......v..#
#.^..v....#
#..^......#
#.........#
##p########
)
(ncrecc)
########g##
##v..###.##
#...^.##.##
#.^...#.^##
#..#......#
##.#......#
##p########
(ncrecc)
########p##
#.........#
#.^...^.v.#
#....v....#
#..^....^.#
##v#......#
##g########
(ncrecc)
###g#######
###....v.##
#######...#
#.........#
#****.v...#
##..##*#..#
#....v.#..#
#......####
##p########
(ncrecc)
###p#######
#.......#*#
#.v.....###
#.......#*#
#.#.....###
#.......#*#
#.^.#***###
#...#***#*#
######g####
message sketches
(ncrecc)
#####g##
####.^##
#p^.^..#
#......#
########
(ncrecc)
#######
#..*..#
#...#.#
#p^.^*.
#...#g#
#######
(ncrecc)
message rudimentary key-and-door system
message like level 2 but much more remote
message for this to be taken full advantage of larger levels would probably need to be used
############
#..........#
#.....v....#
#.p#v.#....#
####v.#....#
#..#v.#....#
#..#v^v^...#
#..####^...#
#.....g.#..#
#....##.#..#
############
message perhaps levels start out small and gradually get larger and larger until something like this is feasible?
message perhaps introduce some mechanic which can transmit magnetic attraction from one space to another without needing to use physical magnets?
message would be nice if there were just a small amount of mechanics that can achieve a lot when used together
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment