X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FDark.js;h=f1bd6c0d5c7b9423118a21ce5f4a544945093ba0;hp=96f50de794027e887aa552c5534a94735847f4e9;hb=69f3d8014e594ef949792d04d97b8286e9c2c268;hpb=1b61a94dbd13f6a37a89e62216615d2496c760a2 diff --git a/public/javascripts/variants/Dark.js b/public/javascripts/variants/Dark.js index 96f50de7..f1bd6c0d 100644 --- a/public/javascripts/variants/Dark.js +++ b/public/javascripts/variants/Dark.js @@ -16,6 +16,7 @@ class DarkRules extends ChessRules updateEnlightened() { + const pawnShift = {"w":-1, "b":1}; // Initialize with pieces positions (which are seen) for (let i=0; i 0) - { - this.kingPos[c][0] = move.appear[0].x; - this.kingPos[c][1] = move.appear[0].y; - } + super.updateVariables(move); if (move.vanish.length >= 2 && move.vanish[1].p == V.KING) { // We took opponent king ! - const oppCol = this.getOppCol(c); - this.kingPos[oppCol] = [-1,-1]; + this.kingPos[this.turn] = [-1,-1]; } // Update moves for both colors: