Checkered stage 2: switch button at reserve position (or on top).
Mode expert: game.js, button on top (with online indicator)
Turn indicator on top too (black or white)
-incheck by checkered pawns: not marked (because of turn changed?)
VariantRules.PlayOnBoard(this.board, move);
}
- undo(move, ingame)
+ undo(move)
{
VariantRules.UndoOnBoard(this.board, move);
this.epSquares.pop();
{
const oppCol = this.vr.turn;
const lastMove = moves[moves.length-1];
- this.vr.undo(lastMove, "ingame");
+ this.vr.undo(lastMove);
this.incheck = this.vr.getCheckSquares(lastMove, oppCol);
this.vr.play(lastMove, "ingame");
}
getCheckSquares(move, c)
{
this.play(move);
+ this.moves.push(move); //artifically change turn, for checkered pawns (TODO)
const kingAttacked = this.isAttacked(this.kingPos[c], this.getOppCol(c))
|| this.isAttacked(this.kingPos[c], 'c');
let res = kingAttacked
? [ JSON.parse(JSON.stringify(this.kingPos[c])) ] //need to duplicate!
: [ ];
+ this.moves.pop();
this.undo(move);
return res;
}