this.newGame("computer");
},
newGame: function(mode, fenInit, color, oppId, moves, continuation) {
- const fen = fenInit || VariantRules.GenRandInitFen();
+ const fen = "rbnqknbr/pppppppp/8/8/8/8/PPPPPPPP/BQRKNNRB 1111";//fenInit || VariantRules.GenRandInitFen();
console.log(fen); //DEBUG
this.score = "*";
if (mode=="human" && !oppId)
this.selectedPiece.style.display = "inline-block";
this.selectedPiece.style.zIndex = 3000;
let startSquare = this.getSquareFromId(e.target.parentNode.id);
- this.possibleMoves = this.mode!="idle" && this.vr.canIplay(this.mycolor,startSquare)
+ this.possibleMoves = true //this.mode!="idle" && this.vr.canIplay(this.mycolor,startSquare)
? this.vr.getPossibleMovesFrom(startSquare)
: [];
+ console.log(this.possibleMoves);
e.target.parentNode.appendChild(this.selectedPiece);
}
},
}
// Complete a move with magnetic actions
+ // TODO: job is done multiple times for (normal) promotions.
applyMagneticLaws(move)
{
const V = VariantRules;
if (this.getColor(i,j) != color)
{
// Attraction
- if ((Math.abs(i-x)>=2 || Math.abs(j-y)>=2)
- && this.getPiece(i,j) != V.KING)
+ if ((Math.abs(i-x)>=2 || Math.abs(j-y)>=2) && this.getPiece(i,j) != V.KING)
{
move.vanish.push(
new PiPo({