Skip to content

Instantly share code, notes, and snippets.

@iamevn
Created April 28, 2020 05:09
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 iamevn/a630104a239333c9dae9effda289cecf to your computer and use it in GitHub Desktop.
Save iamevn/a630104a239333c9dae9effda289cecf to your computer and use it in GitHub Desktop.
Puzzlescript Chess (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
(Hey there!
I see you're reading my code.
Thanks for that!
Also thanks to Jere Majava for helping with the sprites.
I'll do my best to comment out what everything does.)
title Puzzlescript Chess
author Harry Lewis
run_rules_on_level_start
norepeat_action
scanline
noundo (You can't undo a move because it's chess)
norestart
background_color #271F7F
text_color white
========
OBJECTS
========
(BG1 and BG2 make up the chessboard)
BG1
#005CE6
BG2
#271F7F
(Spot denotes a space where a piece can move after you select it
The sprite can be made transparent for advanced players)
Spot
#00FF00
00.00
0...0
.....
0...0
00.00
(Spot2 and Spot3 are generated the same way as spot but are used to look to see if a player is in Check)
Spot2
black
.....
.....
..0..
.....
.....
Spot3
black
.....
.....
..0..
.....
.....
(The border around the table)
Table
#271F7F
(A yellow tile to let you know which piece you selected)
Select
#FFFF00
(The cursor used when selecting which piece to move)
C1
#FF0000
(The cursor used when selecting where to move a selected piece
It looks identical to C1)
C2
#FF0000 #FF0000
00100
01110
11111
01110
00100
(From here on out, we have a all the pieces.
Each peice has a black and white variant
as well as a silhouetted variant for when it is selected.
The names of the objects should be pretty self explanatory)
WPawn
white
.....
.....
..0..
..0..
.000.
WPawnS
darkgrey
.....
.....
..0..
..0..
.000.
BPawn
black
.....
.....
..0..
..0..
.000.
BPawnS
darkgrey
.....
.....
..0..
..0..
.000.
WRook
white
.....
.0.0.
.000.
.000.
.000.
WRookS
darkgrey
.....
.0.0.
.000.
.000.
.000.
BRook
black
.....
.0.0.
.000.
.000.
.000.
BRookS
darkgrey
.....
.0.0.
.000.
.000.
.000.
WKnight
white
.....
.00..
.000.
.00..
.000.
WKnightS
darkgrey
.....
.00..
.000.
.00..
.000.
BKnight
black
.....
.00..
.000.
.00..
.000.
BKnightS
darkgrey
.....
.00..
.000.
.00..
.000.
WKing
white
.....
..0..
.000.
..0..
.000.
WKingS
darkgrey
.....
..0..
.000.
..0..
.000.
BKing
black
.....
..0..
.000.
..0..
.000.
BKingS
darkgrey
.....
..0..
.000.
..0..
.000.
WBish
white
.....
..0..
.0.0.
.000.
.000.
WBishS
darkgrey
.....
..0..
.0.0.
.000.
.000.
BBish
black
.....
..0..
.0.0.
.000.
.000.
BBishS
darkgrey
.....
..0..
.0.0.
.000.
.000.
WQueen
white
.....
0.0.0
.000.
.000.
.000.
WQueenS
darkgrey
.....
0.0.0
.000.
.000.
.000.
BQueen
black
.....
0.0.0
.000.
.000.
.000.
BQueenS
darkgrey
.....
0.0.0
.000.
.000.
.000.
(Here we have the objects at the edge of the screen that mark who's turn it is)
TMW
white #271F7F
11011
11011
01010
10001
11011
TMB
black #271F7F
11011
10001
01010
11011
11011
(Now we get to the invisible variables and constants, these are used for rules later in the game)
(Here we have 2 constants that mark where the pawns starting position is
These are used for initial pawn movement, en passant and promotion)
WPStart (bwhite pawn start spot)
transparent
BPStart (black pawn start spot)
transparent
(Now we have two temporary objects used for placing spots diagonal or an awkward distance from the piece.)
T1
transparent
T2
transparent
(Here are two temporary objects placed for one turn after a pawn moves 2 places at the start, used for en passant)
WEPT (white en passant temp)
transparent
BEPT (black en passant temp)
transparent
(Here are two temps that are used for castling)
CT1
transparent
CT2
transparent
(These temps are used for bishop and queen's spot placement)
BURT (bishop up right temp)
transparent
BDRT (bishop down right temp)
transparent
BULT (bishop up left temp)
transparent
BDLT (bishop down left temp)
transparent
(This temp is for undoing a move if it leave you in check)
UndoTemp
transparent
=======
LEGEND
=======
. = BG1
O = C1
P = WPawn and WPStart
Q = BPawn and BPStart
D = WRook and CT1
S = BRook and CT1
F = WKnight
G = BKnight
J = WKing and CT2
K = BKing and CT2
B = WBish
N = BBish
Z = WQueen
X = BQueen
- = table
R = TMW
Background = BG1 or BG2
Player = C1 or C2
WPiece = WPawn or WRook or WKnight or WKing or WBish or WQueen
BPiece = BPawn or BRook or BKnight or BKing or BBish or BQueen
Piece = Wpiece or BPiece
PieceS = WPawnS or BPawnS or WRookS or BRookS or WKnightS or BKnightS or WKingS or BKingS or WBishS or BBishS or WQueenS or BQueenS
Temp = T1 or T2
TM = TMB or TMW
=======
SOUNDS
=======
sfx0 51986906 (invalid move)
sfx1 43750100 (piece move)
sfx2 44924302 (capture)
sfx3 75528700 (piece select)
sfx4 17761900 (piece deselect)
sfx5 24425705 (castling)
sfx6 94508103 (promotion)
undo 51986906 (invalid move)
================
COLLISIONLAYERS
================
Background
WPStart, BPStart, WEPT, BEPT, CT1, CT2
Temp
UndoTemp
BURT, BULT
BDRT, BDLT
Select
Player, table
Spot
Piece, PieceS
Spot2, Spot3
TM
======
RULES
======
[Action C2 No Spot No PieceS] -> sfx0
[Action C1 No Piece] -> sfx0
[Action C1 WPiece][TMB] -> sfx0
[Action C1 BPiece][TMW] -> sfx0
(*** PAWN ***)
(**White Pawn**)
(Selection)
[Action C1 WPawn][TMW] -> [C2 WPawnS Select][TMW] sfx3
[Action C2 WPawnS Select] -> [C1 WPawn] sfx4
(Spot Placement)
late up [WPawnS|No Piece]->[WPawnS|Spot]
late up [WPawnS WPstart |No Piece| No Piece]->[WPawnS WPstart ||Spot]
late horizontal [WPawnS|]-> [WPawnS|T1]
late up [T1|BPiece]-> [|Spot BPiece]
late up [T1|BEPT]-> [|Spot BEPT]
(Movement)
down [Action C2 Spot||WPawnS WPStart Select][TMW] -> [C1 WPawn|WEPT|WPStart][TMB] sfx1 (first move)
down [Action C2 Spot BEPT|BPawn][WPawnS Select][TMW] -> [C1 WPawn|][][TMB] sfx2 (en passant)
[Action C2 Spot BPiece][WPawnS]-> sfx2 (capture)
[Action C2 Spot No BPiece][WPawnS]-> sfx1 (move)
[Action C2 Spot ][WPawnS Select][TMW] -> [C1 WPawn][][TMB] sfx1
(Promotion)
late up [BPStart|WPawn] -> [BPStart|WPawn] sfx5 message Press down to Promote Pawn to Knight, Any other direction for Queen
up [up C1][BPStart|WPawn] -> [C1][BPStart|WQueen] sfx6
up [left C1][BPStart|WPawn] -> [C1][BPStart|WQueen] sfx6
up [right C1][BPStart|WPawn] -> [C1][BPStart|WQueen] sfx6
up [Action C1][BPStart|WPawn] -> [C1][BPStart|WQueen] sfx6
up [down C1][BPStart|WPawn] -> [C1][BPStart|WKnight] sfx6
(/**White Pawn**)
(**Black Pawn**)
(Selection)
[Action C1 BPawn][TMB] -> [C2 BPawnS Select][TMB] sfx3
[Action C2 BPawnS Select] -> [C1 BPawn] sfx4
(Spot Placement)
late down [BPawnS| No Piece]->[BPawnS|Spot]
late down [BPawnS BPstart |No Piece| No Piece]->[BPawnS BPstart ||Spot]
late horizontal [BPawnS|]-> [BPawnS|T2]
late down [T2|WPiece]-> [|Spot WPiece]
late down [T2|WEPT]-> [|Spot WEPT]
(Movement)
up [Action C2 Spot||BPawnS BPStart Select][TMB] -> [C1 BPawn|BEPT|BPStart][TMW] sfx1 (first move)
up [Action C2 Spot WEPT|WPawn][BPawnS Select][TMB] -> [C1 BPawn|][][TMW] sfx2 (en passant)
[Action C2 Spot WPiece][BPawnS Select]-> sfx2
[Action C2 Spot No WPiece][BPawnS]-> sfx1
[Action C2 Spot][BPawnS Select][TMB] -> [C1 BPawn][][TMW]
(Promotion)
late down [WPStart|BPawn] -> sfx5 message Press down to Promote Pawn to Knight, Any other direction for Queen
down [up C1][WPStart|BPawn] -> [C1][WPStart|BQueen] sfx6
down [left C1][WPStart|BPawn] -> [C1][WPStart|BQueen] sfx6
down [right C1][WPStart|BPawn] -> [C1][WPStart|BQueen] sfx6
down [Action C1][WPStart|BPawn] -> [C1][WPStart|BQueen] sfx6
down [down C1][WPStart|BPawn] -> [C1][WPStart|BKnight] sfx6
(/**Black Pawn**)
(***/PAWN***)
(*** ROOK ***)
(**White Rook**)
(Selection)
[Action C1 WRook][TMW] -> [C2 WRookS Select][TMW] sfx3
[Action C2 WRookS Select] -> [C1 WRook] sfx4
(Spot Placement)
late [WRookS|No WPiece]->[WRookS|Spot]
late [WRookS|Spot No BPiece|No WPiece]->[WRookS|Spot|Spot]
late [WRookS|...|Spot No BPiece|No WPiece]->[WRookS|...|Spot|Spot]
(Movement)
[Action C2 Spot BPiece][WRookS]-> sfx2 (capture)
[Action C2 Spot No BPiece][WRookS]-> sfx1 (move)
[Action C2 Spot ][WRookS Select CT1][TMW] -> [C1 WRook][][TMB] sfx1
[Action C2 Spot ][WRookS Select][TMW] -> [C1 WRook][][TMB] sfx1
(/**White Rook**)
(**Black Rook**)
(Selection)
[Action C1 BRook][TMB] -> [C2 BRookS Select][TMB] sfx3
[Action C2 BRookS Select] -> [C1 BRook] sfx4
(Spot Placement)
late [BRookS|No BPiece]->[BRookS|Spot]
late [BRookS|Spot No WPiece|No BPiece]->[BRookS|Spot|Spot]
late [BRookS|...|Spot No WPiece|No BPiece]->[BRookS|...|Spot|Spot]
(Movement)
[Action C2 Spot WPiece][BRookS]-> sfx2 (capture)
[Action C2 Spot No WPiece][BRookS]-> sfx1 (move)
[Action C2 Spot ][BRookS Select CT1][TMB] -> [C1 BRook][][TMW] sfx1
[Action C2 Spot ][BRookS Select][TMB] -> [C1 BRook][][TMW] sfx1
(/**Black Rook**)
(***/ROOK***)
(*** Knight ***)
(**White Knight**)
(Selection)
[Action C1 WKnight][TMW] -> [C2 WKnightS Select][TMW] sfx3
[Action C2 WKnightS Select] -> [C1 WKnight] sfx4
(Spot Placement)
horizontal late [WKnightS||]->[WKnightS||T1]
vertical late [WKnightS||]->[WKnightS||T2]
vertical late [WKnightS][T1|No WPiece]->[WKnightS][T1|Spot]
horizontal late [WKnightS][T2|No WPiece]->[WKnightS][T2|Spot]
(Movement)
[Action C2 Spot BPiece][WKnightS]-> sfx2 (capture)
[Action C2 Spot No BPiece][WKnightS]-> sfx1 (move)
[Action C2 Spot ][WKnightS Select][TMW] -> [C1 WKnight][][TMB] sfx1
(/**White Knight**)
(**Black Knight**)
(Selection)
[Action C1 BKnight][TMB] -> [C2 BKnightS Select][TMB] sfx3
[Action C2 BKnightS Select] -> [C1 BKnight] sfx4
(Spot Placement)
horizontal late [BKnightS||]->[BKnightS||T1]
vertical late [BKnightS||]->[BKnightS||T2]
vertical late [BKnightS][T1|No BPiece]->[BKnightS][T1|Spot]
horizontal late [BKnightS][T2|No BPiece]->[BKnightS][T2|Spot]
(Movement)
[Action C2 Spot WPiece][BKnightS]-> sfx2 (capture)
[Action C2 Spot No WPiece][BKnightS]-> sfx1 (move)
[Action C2 Spot ][BKnightS Select][TMB] -> [C1 BKnight][][TMW] sfx1
(/**Black Knight**)
(***/Knight***)
(*** Bishop ***)
(**White Bishop**)
(Selection)
[Action C1 WBish][TMW] -> [C2 WBishS Select][TMW] sfx3
[Action C2 WBishS Select] -> [C1 WBish] sfx4
(Spot Placement)
late right [WBishS|]->[WBishS|BURT BDRT]
startLoop
late up [BURT No Spot| WPiece] -> [| WPiece]
late up [BURT No Spot| No WPiece] -> [|BURT Spot]
late right [BURT Spot Piece|] -> [Spot Piece|]
late right [BURT Spot No Piece|] -> [Spot|BURT]
endLoop
startLoop
late down [BDRT No Spot| WPiece] -> [| WPiece]
late down [BDRT No Spot| No WPiece]->[|BDRT Spot]
late right [BDRT Spot Piece|] -> [Spot Piece|]
late right [BDRT Spot No Piece|] -> [Spot|BDRT]
endLoop
late left [WBishS|]->[WBishS|BULT BDLT]
startLoop
late up [BULT No Spot| WPiece]->[|WPiece]
late up [BULT No Spot| No WPiece]->[|BULT Spot]
late left [BULT Spot Piece|] -> [Spot Piece|]
late left [BULT Spot No Piece|] -> [Spot|BULT]
endLoop
startLoop
late down [BDLT No Spot| WPiece]->[|WPiece]
late down [BDLT No Spot| No WPiece]->[|BDLT Spot]
late left [BDLT Spot Piece|] -> [Spot Piece|]
late left [BDLT Spot No Piece|] -> [Spot|BDLT]
endLoop
(Movement)
[Action C2 Spot BPiece][WBishS]-> sfx2 (capture)
[Action C2 Spot No BPiece][WBishS]-> sfx1 (move)
[Action C2 Spot ][WBishS Select][TMW] -> [C1 WBish][][TMB] sfx1
(/**White Bishop**)
(**Black Bishop**)
(Selection)
[Action C1 BBish][TMB] -> [C2 BBishS Select][TMB] sfx3
[Action C2 BBishS Select] -> [C1 BBish] sfx4
(Spot Placement)
late right [BBishS|]->[BBishS|BURT BDRT]
startLoop
late up [BURT No Spot| BPiece] -> [| BPiece]
late up [BURT No Spot| No BPiece] -> [|BURT Spot]
late right [BURT Spot Piece|] -> [Spot Piece|]
late right [BURT Spot No Piece|] -> [Spot|BURT]
endLoop
startLoop
late down [BDRT No Spot| BPiece] -> [| BPiece]
late down [BDRT No Spot| No BPiece]->[|BDRT Spot]
late right [BDRT Spot Piece|] -> [Spot Piece|]
late right [BDRT Spot No Piece|] -> [Spot|BDRT]
endLoop
late left [BBishS|]->[BBishS|BULT BDLT]
startLoop
late up [BULT No Spot| BPiece]->[|BPiece]
late up [BULT No Spot| No BPiece]->[|BULT Spot]
late left [BULT Spot Piece|] -> [Spot Piece|]
late left [BULT Spot No Piece|] -> [Spot|BULT]
endLoop
startLoop
late down [BDLT No Spot| BPiece]->[|BPiece]
late down [BDLT No Spot| No BPiece]->[|BDLT Spot]
late left [BDLT Spot Piece|] -> [Spot Piece|]
late left [BDLT Spot No Piece|] -> [Spot|BDLT]
endLoop
(Movement)
[Action C2 Spot WPiece][BBishS]-> sfx2 (capture)
[Action C2 Spot No WPiece][BBishS]-> sfx1 (move)
[Action C2 Spot ][BBishS Select][TMB] -> [C1 BBish][][TMW] sfx1
(/**Black Bishop**)
(***/Bishop***)
(*** Queen ***)
(**White Queen**)
(Selection)
[Action C1 WQueen][TMW] -> [C2 WQueenS Select][TMW] sfx3
[Action C2 WQueenS Select] -> [C1 WQueen] sfx4
(Spot Placement)
late right [WQueenS|]->[WQueenS|BURT BDRT]
startLoop
late up [BURT No Spot| WPiece] -> [| WPiece]
late up [BURT No Spot| No WPiece] -> [|BURT Spot]
late right [BURT Spot Piece|] -> [Spot Piece|]
late right [BURT Spot No Piece|] -> [Spot|BURT]
endLoop
startLoop
late down [BDRT No Spot| WPiece] -> [| WPiece]
late down [BDRT No Spot| No WPiece]->[|BDRT Spot]
late right [BDRT Spot Piece|] -> [Spot Piece|]
late right [BDRT Spot No Piece|] -> [Spot|BDRT]
endLoop
late left [WQueenS|]->[WQueenS|BULT BDLT]
startLoop
late up [BULT No Spot| WPiece]->[|WPiece]
late up [BULT No Spot| No WPiece]->[|BULT Spot]
late left [BULT Spot Piece|] -> [Spot Piece|]
late left [BULT Spot No Piece|] -> [Spot|BULT]
endLoop
startLoop
late down [BDLT No Spot| WPiece]->[|WPiece]
late down [BDLT No Spot| No WPiece]->[|BDLT Spot]
late left [BDLT Spot Piece|] -> [Spot Piece|]
late left [BDLT Spot No Piece|] -> [Spot|BDLT]
endLoop
late [WQueenS|No WPiece]->[WQueenS|Spot]
late [WQueenS|Spot No BPiece|No WPiece]->[WQueenS|Spot|Spot]
late [WQueenS|...|Spot No BPiece|No WPiece]->[WQueenS|...|Spot|Spot]
(Movement)
[Action C2 Spot BPiece][WQueenS]-> sfx2 (capture)
[Action C2 Spot No BPiece][WQueenS]-> sfx1 (move)
[Action C2 Spot ][WQueenS Select][TMW] -> [C1 WQueen][][TMB] sfx1
(/**White Queen**)
(**Black Queen**)
(Selection)
[Action C1 BQueen][TMB] -> [C2 BQueenS Select][TMB] sfx3
[Action C2 BQueenS Select] -> [C1 BQueen] sfx4
(Spot Placement)
late right [BQueenS|]->[BQueenS|BURT BDRT]
startLoop
late up [BURT No Spot| BPiece] -> [| BPiece]
late up [BURT No Spot| No BPiece] -> [|BURT Spot]
late right [BURT Spot Piece|] -> [Spot Piece|]
late right [BURT Spot No Piece|] -> [Spot|BURT]
endLoop
startLoop
late down [BDRT No Spot| BPiece] -> [| BPiece]
late down [BDRT No Spot| No BPiece]->[|BDRT Spot]
late right [BDRT Spot Piece|] -> [Spot Piece|]
late right [BDRT Spot No Piece|] -> [Spot|BDRT]
endLoop
late left [BQueenS|]->[BQueenS|BULT BDLT]
startLoop
late up [BULT No Spot| BPiece]->[|BPiece]
late up [BULT No Spot| No BPiece]->[|BULT Spot]
late left [BULT Spot Piece|] -> [Spot Piece|]
late left [BULT Spot No Piece|] -> [Spot|BULT]
endLoop
startLoop
late down [BDLT No Spot| BPiece]->[|BPiece]
late down [BDLT No Spot| No BPiece]->[|BDLT Spot]
late left [BDLT Spot Piece|] -> [Spot Piece|]
late left [BDLT Spot No Piece|] -> [Spot|BDLT]
endLoop
late [BQueenS|No BPiece]->[BQueenS|Spot]
late [BQueenS|Spot No WPiece|No BPiece]->[BQueenS|Spot|Spot]
late [BQueenS|...|Spot No WPiece|No BPiece]->[BQueenS|...|Spot|Spot]
(Movement)
[Action C2 Spot WPiece][BQueenS]-> sfx2 (capture)
[Action C2 Spot No WPiece][BQueenS]-> sfx1 (move)
[Action C2 Spot ][BQueenS Select][TMB] -> [C1 BQueen][][TMW] sfx1
(/**Black Queen**)
(***/Queen***)
(*** King ***)
(**White King**)
(Selection)
[Action C1 WKing][TMW] -> [C2 WKingS Select][TMW] sfx3
[Action C2 WKingS Select] -> [C1 WKing] sfx4
(Spot Placement)
horizontal late [WKingS|]->[WKingS|T1]
vertical late [WKingS|]->[WKingS|T2]
vertical late [WKingS][T1|No WPiece]->[WKingS][T1|Spot]
horizontal late [WKingS][T2|No WPiece]->[WKingS][T2|Spot]
late [WKingS|No WPiece]->[WKingS|Spot]
late [WKingS CT2|No Piece|No Piece|WRook CT1]->[WKingS CT2||Spot|WRook CT1]
late [WKingS CT2|No Piece|No Piece|No Piece|WRook CT1]->[WKingS CT2||Spot||WRook CT1]
(Movement)
[Action C2 Spot BPiece][WKingS]-> sfx2 (capture)
[Action C2 Spot No BPiece][WKingS]-> sfx1 (move)
[WKingS Select CT2||Action C2 Spot|WRook CT1][TMW]->[|WRook|C1 WKing|][TMB] sfx5 (castling)
[WKingS Select CT2||Action C2 Spot||WRook CT1][TMW]->[|WRook|C1 WKing||][TMB] sfx5 (castling)
[Action C2 Spot ][WKingS Select CT2][TMW] -> [C1 WKing][][TMB] sfx1
[Action C2 Spot ][WKingS Select][TMW] -> [C1 WKing][][TMB] sfx1
(/**White King**)
(**Black King**)
(Selection)
[Action C1 BKing][TMB] -> [C2 BKingS Select][TMB] sfx3
[Action C2 BKingS Select] -> [C1 BKing] sfx4
(Spot Placement)
horizontal late [BKingS|]->[BKingS|T1]
vertical late [BKingS|]->[BKingS|T2]
vertical late [BKingS][T1|No BPiece]->[BKingS][T1|Spot]
horizontal late [BKingS][T2|No BPiece]->[BKingS][T2|Spot]
late [BKingS|No BPiece]->[BKingS|Spot]
late [BKingS CT2|No Piece|No Piece|BRook CT1]->[BKingS CT2||Spot|BRook CT1]
late [BKingS CT2|No Piece|No Piece|No Piece|BRook CT1]->[BKingS CT2||Spot||BRook CT1]
(Movement)
[Action C2 Spot WPiece][BKingS]-> sfx2 (capture)
[Action C2 Spot No WPiece][BKingS]-> sfx1 (move)
[BKingS Select CT2||Action C2 Spot|BRook CT1][TMB]->[|BRook|C1 BKing|][TMW] sfx5 (castling)
[BKingS Select CT2||Action C2 Spot||BRook CT1][TMB]->[|BRook|C1 BKing||][TMW] sfx5 (castling)
[Action C2 Spot ][BKingS Select CT2][TMB] -> [C1 BKing][][TMW] sfx1
[Action C2 Spot ][BKingS Select][TMB] -> [C1 BKing][][TMW] sfx1
(/**Black King**)
(***/King***)
(Turn Cancelling for Selection with no spots)
late [PieceS] -> [PieceS UndoTemp]
late [PieceS UndoTemp][Spot No Table] -> [PieceS][Spot]
late [PieceS UndoTemp] -> cancel
(Turn Changing)
(White looks if Black is in check)
(Bishop)
late right [WBish|]->[WBish|BURT BDRT]
startLoop
late up [BURT No Spot2| WPiece] -> [| WPiece]
late up [BURT No Spot2| No WPiece] -> [|BURT Spot2]
late right [BURT Spot2 Piece|] -> [Spot2 Piece|]
late right [BURT Spot2 No Piece|] -> [Spot2|BURT]
endLoop
startLoop
late down [BDRT No Spot2| WPiece] -> [| WPiece]
late down [BDRT No Spot2| No WPiece]->[|BDRT Spot2]
late right [BDRT Spot2 Piece|] -> [Spot2 Piece|]
late right [BDRT Spot2 No Piece|] -> [Spot2|BDRT]
endLoop
late left [WBish|]->[WBish|BULT BDLT]
startLoop
late up [BULT No Spot2| WPiece]->[|WPiece]
late up [BULT No Spot2| No WPiece]->[|BULT Spot2]
late left [BULT Spot2 Piece|] -> [Spot2 Piece|]
late left [BULT Spot2 No Piece|] -> [Spot2|BULT]
endLoop
startLoop
late down [BDLT No Spot2| WPiece]->[|WPiece]
late down [BDLT No Spot2| No WPiece]->[|BDLT Spot2]
late left [BDLT Spot2 Piece|] -> [Spot2 Piece|]
late left [BDLT Spot2 No Piece|] -> [Spot2|BDLT]
endLoop
late [BURT]->[]
late [BDRT]->[]
late [BULT]->[]
late [BDLT]->[]
(Queen)
late right [WQueen|]->[WQueen|BURT BDRT]
startLoop
late up [BURT No Spot3| WPiece] -> [| WPiece]
late up [BURT No Spot3| No WPiece] -> [|BURT Spot3]
late right [BURT Spot3 Piece|] -> [Spot3 Piece|]
late right [BURT Spot3 No Piece|] -> [Spot3|BURT]
endLoop
startLoop
late down [BDRT No Spot3| WPiece] -> [| WPiece]
late down [BDRT No Spot3| No WPiece]->[|BDRT Spot3]
late right [BDRT Spot3 Piece|] -> [Spot3 Piece|]
late right [BDRT Spot3 No Piece|] -> [Spot3|BDRT]
endLoop
late left [WQueen|]->[WQueen|BULT BDLT]
startLoop
late up [BULT No Spot3| WPiece]->[|WPiece]
late up [BULT No Spot3| No WPiece]->[|BULT Spot3]
late left [BULT Spot3 Piece|] -> [Spot3 Piece|]
late left [BULT Spot3 No Piece|] -> [Spot3|BULT]
endLoop
startLoop
late down [BDLT No Spot3| WPiece]->[|WPiece]
late down [BDLT No Spot3| No WPiece]->[|BDLT Spot3]
late left [BDLT Spot3 Piece|] -> [Spot3 Piece|]
late left [BDLT Spot3 No Piece|] -> [Spot3|BDLT]
endLoop
late [WQueen|No WPiece]->[WQueen|Spot3]
late [WQueen|Spot3 No BPiece|No WPiece]->[WQueen|Spot3|Spot3]
late [WQueen|...|Spot3 No BPiece|No WPiece]->[WQueen|...|Spot3|Spot3]
late [BURT]->[]
late [BDRT]->[]
late [BULT]->[]
late [BDLT]->[]
(Pawn)
late horizontal [WPawn|]-> [WPawn|T1]
late up [T1|BPiece]-> [|Spot2 BPiece]
late up [T1|BEPT]-> [|Spot2 BEPT]
late [T1]->[]
(Rook)
late [WRook|No WPiece]->[WRook|Spot2]
late [WRook|Spot2 No BPiece|No WPiece]->[WRook|Spot2|Spot2]
late [WRook|...|Spot2 No BPiece|No WPiece]->[WRook|...|Spot2|Spot2]
(Knight)
horizontal late [WKnight||]->[WKnight||T1]
vertical late [WKnight||]->[WKnight||T2]
vertical late [WKnight][T1|No WPiece]->[WKnight][T1|Spot2]
horizontal late [WKnight][T2|No WPiece]->[WKnight][T2|Spot2]
late [T1]->[]
late [T2]->[]
(King)
horizontal late [WKing|]->[WKing|T1]
vertical late [WKing|]->[WKing|T2]
vertical late [WKing][T1|No WPiece]->[WKing][T1|Spot2]
horizontal late [WKing][T2|No WPiece]->[WKing][T2|Spot2]
late [WKing|No WPiece]->[WKing|Spot2]
late [T1]->[]
late [T2]->[]
late [Spot3] -> [Spot2]
late down [TMB|...|TMW][Spot2 BKing] -> Message Black is in check.
late down [TMW|...|TMB][Spot2 BKing] -> cancel
late [Spot2]->[]
late [Spot3]->[]
(Black Looks if White is in check)
(Bishop)
late right [BBish|]->[BBish|BURT BDRT]
startLoop
late up [BURT No Spot2| BPiece] -> [| BPiece]
late up [BURT No Spot2| No BPiece] -> [|BURT Spot2]
late right [BURT Spot2 Piece|] -> [Spot2 Piece|]
late right [BURT Spot2 No Piece|] -> [Spot2|BURT]
endLoop
startLoop
late down [BDRT No Spot2| BPiece] -> [| BPiece]
late down [BDRT No Spot2| No BPiece]->[|BDRT Spot2]
late right [BDRT Spot2 Piece|] -> [Spot2 Piece|]
late right [BDRT Spot2 No Piece|] -> [Spot2|BDRT]
endLoop
late left [BBish|]->[BBish|BULT BDLT]
startLoop
late up [BULT No Spot2| BPiece]->[|BPiece]
late up [BULT No Spot2| No BPiece]->[|BULT Spot2]
late left [BULT Spot2 Piece|] -> [Spot2 Piece|]
late left [BULT Spot2 No Piece|] -> [Spot2|BULT]
endLoop
startLoop
late down [BDLT No Spot2| BPiece]->[|BPiece]
late down [BDLT No Spot2| No BPiece]->[|BDLT Spot2]
late left [BDLT Spot2 Piece|] -> [Spot2 Piece|]
late left [BDLT Spot2 No Piece|] -> [Spot2|BDLT]
endLoop
late [BURT]->[]
late [BDRT]->[]
late [BULT]->[]
late [BDLT]->[]
(Queen)
late right [BQueen|]->[BQueen|BURT BDRT]
startLoop
late up [BURT No Spot3| BPiece] -> [| BPiece]
late up [BURT No Spot3| No BPiece] -> [|BURT Spot3]
late right [BURT Spot3 Piece|] -> [Spot3 Piece|]
late right [BURT Spot3 No Piece|] -> [Spot3|BURT]
endLoop
startLoop
late down [BDRT No Spot3| BPiece] -> [| BPiece]
late down [BDRT No Spot3| No BPiece]->[|BDRT Spot3]
late right [BDRT Spot3 Piece|] -> [Spot3 Piece|]
late right [BDRT Spot3 No Piece|] -> [Spot3|BDRT]
endLoop
late left [BQueen|]->[BQueen|BULT BDLT]
startLoop
late up [BULT No Spot3| BPiece]->[|BPiece]
late up [BULT No Spot3| No BPiece]->[|BULT Spot3]
late left [BULT Spot3 Piece|] -> [Spot3 Piece|]
late left [BULT Spot3 No Piece|] -> [Spot3|BULT]
endLoop
startLoop
late down [BDLT No Spot3| BPiece]->[|BPiece]
late down [BDLT No Spot3| No BPiece]->[|BDLT Spot3]
late left [BDLT Spot3 Piece|] -> [Spot3 Piece|]
late left [BDLT Spot3 No Piece|] -> [Spot3|BDLT]
endLoop
late [BQueen|No BPiece]->[BQueen|Spot3]
late [BQueen|Spot3 No WPiece|No BPiece]->[BQueen|Spot3|Spot3]
late [BQueen|...|Spot3 No WPiece|No BPiece]->[BQueen|...|Spot3|Spot3]
late [BURT]->[]
late [BDRT]->[]
late [BULT]->[]
late [BDLT]->[]
(Pawn)
late horizontal [BPawn|]-> [BPawn|T1]
late down [T1|WPiece]-> [|Spot2 WPiece]
late down [T1|WEPT]-> [|Spot2 WEPT]
late [T1]->[]
(Rook)
late [BRook|No BPiece]->[BRook|Spot2]
late [BRook|Spot2 No WPiece|No BPiece]->[BRook|Spot2|Spot2]
late [BRook|...|Spot2 No WPiece|No BPiece]->[BRook|...|Spot2|Spot2]
(Knight)
horizontal late [BKnight||]->[BKnight||T1]
vertical late [BKnight||]->[BKnight||T2]
vertical late [BKnight][T1|No BPiece]->[BKnight][T1|Spot2]
horizontal late [BKnight][T2|No BPiece]->[BKnight][T2|Spot2]
late [T1]->[]
late [T2]->[]
(King)
horizontal late [BKing|]->[BKing|T1]
vertical late [BKing|]->[BKing|T2]
vertical late [BKing][T1|No BPiece]->[BKing][T1|Spot2]
horizontal late [BKing][T2|No BPiece]->[BKing][T2|Spot2]
late [BKing|No BPiece]->[BKing|Spot2]
late [T1]->[]
late [T2]->[]
late [Spot3] -> [Spot2]
late down [TMW|...|TMB][Spot2 WKing] -> Message White is in check.
late down [TMB|...|TMW][Spot2 WKing] -> cancel
late [Spot2]->[]
late [Spot3]->[]
startLoop
late down [TMB|...| TMW][BEPT]->[TMB|...|TMW][]
late right [TMB|...|TMW]->[TMB|...|TMB](white->black)
late down [TMB|...|TMW]->[TMB|...|TMB](white->black)
late down [TMW|...|TMB][WEPT]->[TMW|...|TMB][]
late right [TMW|...|TMB]->[TMW|...|TMW](black->white)
late down [TMW|...|TMB]->[TMW|...|TMW](black->white)
endLoop
[Spot]->[]
[Temp]->[]
[UndoTemp]->[]
[BURT]->[]
[BDRT]->[]
[BULT]->[]
[BDLT]->[]
late [Spot table] -> [table]
late [Spot2 table] -> [table]
late [Spot3 table] -> [table]
(Background Generation)
down [BG1|BG1]->[BG1|BG2]
right [BG1|BG1]->[BG1|BG2]
right [BG2|BG2]->[BG2|BG1]
(Endgame checker)
==============
WINCONDITIONS
==============
=======
LEVELS
=======
Message Welcome to Puzzlescript Chess.
Message This game is to be played with two players sharing a computer.
Message Checkmate is triggered by being unable to make a move while in check.
Message Stalemate isn't and can't be implemented.
Message Unfortunately, games cannot be saved. The continue button from the main menu will only skip this text.
Message Sound effects are helpful to know if a move is doable or not.
Message A move cannot be undone.
Message To restart the game, refresh the page.
Message Have fun!
----------------
----SGNXKNGS----
--R-QQQQQQQQ-R--
----........----
----........----
----........----
----...O....----
--R-PPPPPPPP-R--
----DFBZJBFD----
----------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment