X-Git-Url: https://git.auder.net/assets/discord.svg?a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=5ad33d079ef77cfdabe28690131ddf6dc9b2ad03;hb=5bfb09560aa346d132e829a7c63558407bcc8091;hp=18632858d6e653a9d74bf71e3c6b1a44119064b5;hpb=204e289bbcddc69e2d81aef492dbea6db9e31188;p=vchess.git diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 18632858..5ad33d07 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -412,7 +412,6 @@ Vue.component('my-game', { }; const socketMessageListener = msg => { const data = JSON.parse(msg.data); - console.log("Receive message: " + data.code); switch (data.code) { case "newgame": //opponent found @@ -575,7 +574,7 @@ Vue.component('my-game', { 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) @@ -635,7 +634,7 @@ Vue.component('my-game', { } else //against computer { - this.mycolor = Math.random() < 0.5 ? 'w' : 'b'; + this.mycolor = "w";//Math.random() < 0.5 ? 'w' : 'b'; if (this.mycolor == 'b') setTimeout(this.playComputerMove, 500); } @@ -673,9 +672,10 @@ 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) : []; + console.log(this.possibleMoves); e.target.parentNode.appendChild(this.selectedPiece); } },