elementArray.push(gameDiv);
if (!!this.vr.reserve)
{
+ const shiftIdx = (this.mycolor=="w" ? 0 : 1);
let myReservePiecesArray = [];
for (let i=0; i<VariantRules.RESERVE_PIECES.length; i++)
{
myReservePiecesArray.push(h('div',
{
'class': {'board':true, ['board'+sizeY]:true},
- attrs: { id: this.getSquareId({x:sizeX,y:i}) }
+ attrs: { id: this.getSquareId({x:sizeX+shiftIdx,y:i}) }
},
[
h('img',
oppReservePiecesArray.push(h('div',
{
'class': {'board':true, ['board'+sizeY]:true},
- attrs: { id: this.getSquareId({x:sizeX,y:i}) }
+ attrs: { id: this.getSquareId({x:sizeX+(1-shiftIdx),y:i}) }
},
[
h('img',
this.possibleMoves = this.mode!="idle" && this.vr.canIplay(this.mycolor,startSquare)
? this.vr.getPossibleMovesFrom(startSquare)
: [];
+ console.log(this.possibleMoves);
+ console.log(this.vr.promoted);
e.target.parentNode.appendChild(this.selectedPiece);
}
},