projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix mode in PGN
[vchess.git]
/
public
/
javascripts
/
components
/
game.js
diff --git
a/public/javascripts/components/game.js
b/public/javascripts/components/game.js
index
8e8e277
..
96833bc
100644
(file)
--- a/
public/javascripts/components/game.js
+++ b/
public/javascripts/components/game.js
@@
-616,6
+616,7
@@
Vue.component('my-game', {
this.oppConnected = true;
this.mycolor = color;
this.seek = false;
this.oppConnected = true;
this.mycolor = color;
this.seek = false;
+ this.mode = "human";
if (!!moves && moves.length > 0) //imply continuation
{
const lastMove = moves[moves.length-1];
if (!!moves && moves.length > 0) //imply continuation
{
const lastMove = moves[moves.length-1];
@@
-628,6
+629,7
@@
Vue.component('my-game', {
}
else //against computer
{
}
else //against computer
{
+ this.mode = "computer";
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);