X-Git-Url: https://git.auder.net/assets/icon_infos.svg?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=a7acc10d164e128d9c446ff83ddea3f47fba6128;hb=9de73b71a1db5464f89a202e6cdfdc7b6b6b0753;hp=ca8a6bff425b917199e5287059de2d065d97f4c7;hpb=f6cc7faf4301dc4a7ae5bb07f16403f280beddc3;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index ca8a6bff..a7acc10d 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -574,7 +574,9 @@ Vue.component('my-game', { this.newGame("computer"); }, newGame: function(mode, fenInit, color, oppId, moves, continuation) { - const fen = "pppppppp/rnbqkbnr/8/8/8/8/PPPPPPPP/ROBQKBOR 1111"; //fenInit || VariantRules.GenRandInitFen(); + //const fen = "bbrkqnrn/pppppppp/8/8/8/8/PPPPPPPP/NNRKQBBR 1111"; + //const fen = "bbrkqnr1/pppppp1p/6o1/6s1/3SS3/8/PPP2PPP/NNRKQBBR 1111"; //first 2 moves == pb + const fen = fenInit || VariantRules.GenRandInitFen(); console.log(fen); //DEBUG this.score = "*"; if (mode=="human" && !oppId) @@ -634,6 +636,7 @@ Vue.component('my-game', { } else //against computer { + //this.mycolor = "w"; this.mycolor = Math.random() < 0.5 ? 'w' : 'b'; if (this.mycolor == 'b') setTimeout(this.playComputerMove, 500); @@ -672,7 +675,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 = true//this.mode!="idle" && this.vr.canIplay(this.mycolor,startSquare) + this.possibleMoves = this.mode!="idle" && this.vr.canIplay(this.mycolor,startSquare) ? this.vr.getPossibleMovesFrom(startSquare) : []; e.target.parentNode.appendChild(this.selectedPiece);