projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Further fix in Alice chess; still some issues
[vchess.git]
/
public
/
javascripts
/
components
/
game.js
diff --git
a/public/javascripts/components/game.js
b/public/javascripts/components/game.js
index
e3cc6af
..
a7acc10
100644
(file)
--- a/
public/javascripts/components/game.js
+++ b/
public/javascripts/components/game.js
@@
-574,6
+574,8
@@
Vue.component('my-game', {
this.newGame("computer");
},
newGame: function(mode, fenInit, color, oppId, moves, continuation) {
this.newGame("computer");
},
newGame: function(mode, fenInit, color, oppId, moves, continuation) {
+ //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 = "*";
const fen = fenInit || VariantRules.GenRandInitFen();
console.log(fen); //DEBUG
this.score = "*";
@@
-634,6
+636,7
@@
Vue.component('my-game', {
}
else //against computer
{
}
else //against computer
{
+ //this.mycolor = "w";
this.mycolor = Math.random() < 0.5 ? 'w' : 'b';
if (this.mycolor == 'b')
setTimeout(this.playComputerMove, 500);
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.selectedPiece.style.display = "inline-block";
this.selectedPiece.style.zIndex = 3000;
let startSquare = this.getSquareFromId(e.target.parentNode.id);
- this.possibleMoves = t
rue//t
his.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);
? this.vr.getPossibleMovesFrom(startSquare)
: [];
e.target.parentNode.appendChild(this.selectedPiece);