Skip to content

Instantly share code, notes, and snippets.

@ncrecc
Created April 25, 2019 05:42
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/69d473db65dd167eb8abe998e7fcbc74 to your computer and use it in GitHub Desktop.
Save ncrecc/69d473db65dd167eb8abe998e7fcbc74 to your computer and use it in GitHub Desktop.
Simple Block Swapping Game (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Simple Block Swapping Game
homepage www.puzzlescript.net
========
OBJECTS
========
Background
LIGHTGREEN GREEN
11111
01111
11101
11111
10111
Target
DarkBlue
.....
.000.
.0.0.
.000.
.....
Wall
BROWN DARKBROWN
00010
11111
01000
11111
00010
Player
Black Orange White Blue
.000.
.111.
22222
.333.
.3.3.
Crate
Orange Yellow
00000
0...0
0...0
0...0
00000
RedDotTop
Red
..0..
.....
.....
.....
.....
RedDotLeft
Red
.....
.....
0....
.....
.....
RedDotBottom
Red
.....
.....
.....
.....
..0..
RedDotRight
Red
.....
.....
....0
.....
.....
=======
LEGEND
=======
. = Background
# = Wall
P = Player
* = Crate
@ = Crate and Target
O = Target
1 = RedDotTop and RedDotLeft and RedDotBottom and RedDotRight and Crate
2 = RedDotTop and RedDotLeft and Crate
3 = RedDotBottom and RedDotRight and Crate
4 = RedDotBottom and RedDotTop and Crate
5 = RedDotLeft and RedDotRight and Crate
6 = RedDotLeft and RedDotTop and RedDotBottom and Crate
7 = RedDotRight and RedDotTop and RedDotBottom and Crate
8 = RedDotBottom and RedDotLeft and RedDotRight and Crate
9 = RedDotTop and RedDotLeft and RedDotRight and Crate
A = RedDotTop and Crate
B = RedDotLeft and Crate
C = RedDotBottom and Crate
D = RedDotRight and Crate
RedDots = RedDotTop or RedDotLeft or RedDotBottom or RedDotRight
=======
SOUNDS
=======
Crate MOVE 36772507
================
COLLISIONLAYERS
================
Background
Target
Player, Wall, Crate
RedDotTop
RedDotLeft
RedDotBottom
RedDotRight
======
RULES
======
(Is there a way to get all dots to remain on a crate when the player swaps with it without checking for every possible combination of dots? Being angry over 14 lines may seem silly, but imagine, say, TopLeft, TopRight, BottomRight, and BottomLeft dots were added - that would significantly increase the complexity of the situation and amount of redundant lines.)
[> Player|...|Crate RedDots] -> [Crate RedDots|...|Player] (This is what I tried, but only one dot is transferred when the player swaps, rather than all of them (when there are multiple). Is there some way to streamline the transfer of dots?)
[> Player|...|Crate] -> [Crate|...|Player] (Rule for swapping a player with a dotless crate.)
==============
WINCONDITIONS
==============
=======
LEVELS
=======
##########
#........#
#.p......#
#......2.#
#.5......#
#.....1..#
#..3.....#
#....4...#
#........#
##########
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment