X-Git-Url: https://git.auder.net/pieces/Cwda/n_black_bishop.svg?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=e3cc6af0716fe50bdad8909fcd1208c4666cc6ce;hb=270968d6f8b17065cfe18279d9ee7973107a1048;hp=74092b5614ca1eb61dd67f1cbc9d57c213a44686;hpb=aea1443ebf56afb2c507c2830ac6b67b509778bc;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 74092b56..e3cc6af0 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -634,7 +634,7 @@ Vue.component('my-game', { } else //against computer { - this.mycolor = "w";//Math.random() < 0.5 ? 'w' : 'b'; + this.mycolor = Math.random() < 0.5 ? 'w' : 'b'; if (this.mycolor == 'b') setTimeout(this.playComputerMove, 500); } @@ -672,7 +672,7 @@ Vue.component('my-game', { 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) : []; e.target.parentNode.appendChild(this.selectedPiece);