Skip to content

Instantly share code, notes, and snippets.

@Stingby12
Created October 27, 2025 19:20
Show Gist options
  • Select an option

  • Save Stingby12/c68543e2cbbf409bee7254c29d617111 to your computer and use it in GitHub Desktop.

Select an option

Save Stingby12/c68543e2cbbf409bee7254c29d617111 to your computer and use it in GitHub Desktop.
Knights and Rooks (Puzzlescript Plus Script)
Play this game by pasting the script in https://auroriax.github.io/PuzzleScript/editor.html
title Knights and Rooks
author Stingby12
homepage www.puzzlescript.net
run_rules_on_level_start
sprite_size 15
========
OBJECTS
========
Background
gray
Tile0
#777 #666
000000000000000
011111111111110
010000000000010
010000000000010
010000000000010
010000000000010
010000000000010
010000000000010
010000000000010
010000000000010
010000000000010
010000000000010
010000000000010
011111111111110
000000000000000
Tile1 copy:Tile0
#FCF #FBF
TargetWx
transparent
TargetBx
transparent
TargetW0 copy:Tile0
#AAA #BBB
TargetW1 copy:Tile0
#CCC #BBB
TargetB0 copy:Tile0
#333 #222
TargetB1 copy:Tile0
#111 #222
Wall
#000 #f0f
111111111111111
100000000000001
100000000000001
100010000010001
100111111111001
100010010010001
100010000010001
100011000110001
100010000010001
100010010010001
100111111111001
100010000010001
100000000000001
100000000000001
111111111111111
WallH
#000 #f0f
111111111111111
000000000000000
000000010000000
100000010000001
111111111111111
100000010000001
000000010000000
000110000011000
000000010000000
100000010000001
111111111111111
100000010000001
000000010000000
000000000000000
111111111111111
Void
#000
VoidU
#B0B
000000000000000
00....000....00
0......0......0
.......0.......
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
VoidD
#B0B
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
.......0.......
0......0......0
00....000....00
000000000000000
VoidL
#B0B
000............
00.............
0..............
0..............
0..............
0..............
00.............
0000...........
00.............
0..............
0..............
0..............
0..............
00.............
000............
VoidR
#B0B
............000
.............00
..............0
..............0
..............0
..............0
.............00
...........0000
.............00
..............0
..............0
..............0
..............0
.............00
............000
VoidUL
#B0B
0000...........
000............
00.............
0..............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
VoidUR
#B0B
...........0000
............000
.............00
..............0
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
VoidDL
#B0B
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
0..............
00.............
000............
0000...........
VoidDR
#B0B
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
..............0
.............00
............000
...........0000
Player
#0ff
...............
.00000...00000.
.0...........0.
.0...........0.
.0.....0.....0.
.0.....0.....0.
.......0.......
....0000000....
.......0.......
.0.....0.....0.
.0.....0.....0.
.0...........0.
.0...........0.
.00000...00000.
...............
RookW
#fff #000 #ccc #aaa
...............
..11.1.1.1.11..
..10101010101..
..10000000001..
..12222222221..
..10000000001..
...122222221...
....1333331....
....1333331....
....1333331....
...122222221...
..10000000001..
.1222222222221.
.1000000000001.
.1111111111111.
BishopW
#fff #000 #ccc #aaa
.......1.......
.....11011.....
....1000001....
...100030001...
...100333001...
...103303301...
...100000001...
....1000001....
....1333331....
....1333331....
...100000001...
..12222222221..
..10000000001..
..10000000001..
..11111111111..
KnightW
#fff #000 #ccc #aaa
...............
.......11......
.....11001.....
....1000001....
...100100001...
..1000000001...
..1001100001...
...111000001...
....1000001....
....1222221....
.....13331.....
....1222221....
...100000001...
..10000000001..
..11111111111..
KnightB
#666 #000 #333 #111
...............
......11.......
.....10011.....
....1000001....
...100001001...
...1000000001..
...1000011001..
...100000111...
....1000001....
....1222221....
.....13331.....
....1222221....
...100000001...
..10000000001..
..11111111111..
MoveCheck
#0F0
...............
...............
...............
...............
...............
...............
......000......
......000......
......000......
...............
...............
...............
...............
...............
...............
BishopX
transparent
KnightXH1
transparent
KnightXH2
transparent
KnightXV1
transparent
KnightXV2
transparent
=======
LEGEND
=======
. = Background
# = Wall
% = Void
@ = Player
R = RookW and TargetBx
K = KnightB and TargetWx
Pieces = RookW or BishopW or KnightW or KnightB
Walls = Wall or WallH
Tile = Tile0 or Tile1
TargetB = TargetB1 or TargetB0
TargetW = TargetW1 or TargetW0
Temp = BishopX or KnightXH1 or KnightXH2 or KnightXV1 or KnightXV2
Block = Walls or Pieces or Void
=======
SOUNDS
=======
startgame 9727100947007300
sfx0 82034306
sfx1 57409304
endlevel 97277300
================
COLLISIONLAYERS
================
Background
Tile
TargetWx
TargetBx
TargetW
TargetB
Walls, Void
Pieces
MoveCheck
BishopX
KnightXH1
KnightXH2
KnightXV1
KnightXV2
VoidU
VoidD
VoidL
VoidR
VoidUL
VoidUR
VoidDL
VoidDR
Player
======
RULES
======
[ Player no Tile ] -> [ Player Tile0 ]
+ [ Tile0 | no Tile ] -> [ Tile0 | Tile1 ]
+ [ Tile1 | no Tile ] -> [ Tile1 | Tile0 ]
[ TargetWx Tile0 ] -> [ TargetW0 Tile0 ]
[ TargetWx Tile1 ] -> [ TargetW1 Tile1 ]
[ TargetBx Tile0 ] -> [ TargetB0 Tile0 ]
[ TargetBx Tile1 ] -> [ TargetB1 Tile1 ]
horizontal [ Walls | Walls | Walls ] -> [ Walls | WallH | Walls ]
up [ Void | no Void ] -> [ Void VoidU | ]
down [ Void | no Void ] -> [ Void VoidD | ]
left [ Void | no Void ] -> [ Void VoidL | ]
right [ Void | no Void ] -> [ Void VoidR | ]
up [ Void no VoidL | VoidL ] -> [ Void VoidUL | VoidL ]
up [ Void no VoidR | VoidR ] -> [ Void VoidUR | VoidR ]
down [ Void no VoidL | VoidL ] -> [ Void VoidDL | VoidL ]
down [ Void no VoidR | VoidR ] -> [ Void VoidDR | VoidR ]
late [ Temp ] -> [ ]
late [ MoveCheck ] -> [ ]
late [ Player RookW | no Block ] -> [ Player RookW | MoveCheck ]
late vertical [ Player BishopW | ] -> [ Player BishopW | BishopX ]
late horizontal [ BishopX | no Block ] -> [ BishopX | MoveCheck ]
late vertical [ Player KnightW | ] -> [ Player KnightW | KnightXV1 ]
late vertical [ Player KnightB | ] -> [ Player KnightB | KnightXV1 ]
late vertical [ KnightXV1 | no Player ] -> [ KnightXV1 | KnightXV2 ]
late horizontal [ KnightXV2 | no Block ] -> [ KnightXV2 | MoveCheck ]
late horizontal [ Player KnightW | ] -> [ Player KnightW | KnightXH1 ]
late horizontal [ Player KnightB | ] -> [ Player KnightB | KnightXH1 ]
late horizontal [ KnightXH1 | no Player ] -> [ KnightXH1 | KnightXH2 ]
late vertical [ KnightXH2 | no Block ] -> [ KnightXH2 | MoveCheck ]
[ action Player RookW ] [ MoveCheck ] -> [ Player ] [ RookW ] sfx0
[ action Player BishopW ] [ MoveCheck ] -> [ Player ] [ BishopW ] sfx0
[ action Player KnightW ] [ MoveCheck ] -> [ Player ] [ KnightW ] sfx0
[ action Player KnightB ] [ MoveCheck ] -> [ Player ] [ KnightB ] sfx0
[ action Player Pieces ] -> sfx1
[ > Player ] -> [ > Player ] nosave
==============
WINCONDITIONS
==============
all KnightB on TargetB
all RookW on TargetW
=======
LEVELS
=======
message Move all of the knights to the right side and the rooks to the left side.
%%%%%%%
%#k#r#%
%kk#rr%
%kk@rr%
%k###r%
%%%%%%%
message WE ARE SO BACK ON PUZZLESCRIPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment