-setStorage, updateStorage in case of computer game: fix that
-Implement chat (new mode ?! why not... still listen to oppid (dis)connect)
Beautify styles
Translations ? (probably not)
Fill some puzzles: http://www.logicmazes.com/games/puz1to4.html
'class': { 'game': true },
},
[_.range(sizeX).map(i => {
- let ci = this.mycolor=='w' ? i : sizeX-i-1;
+ let ci = (this.mycolor=='w' ? i : sizeX-i-1);
return h(
'div',
{
style: { 'opacity': this.choices.length>0?"0.5":"1" },
},
_.range(sizeY).map(j => {
- let cj = this.mycolor=='w' ? j : sizeY-j-1;
+ let cj = (this.mycolor=='w' ? j : sizeY-j-1);
let elems = [];
if (this.vr.board[ci][cj] != VariantRules.EMPTY)
{
if (this.sound >= 1)
new Audio("/sounds/newgame.mp3").play().catch(err => {});
document.getElementById("modal-newgame").checked = false;
+ this.setStorage(); //in case of interruptions
}
this.oppid = oppId;
this.oppConnected = !continuation;
this.mycolor = color;
this.seek = false;
- this.setStorage(); //in case of interruptions
}
else if (mode == "computer")
{
- this.setStorage(); //store game state
this.compWorker.postMessage(["init",this.vr.getFen()]);
- this.mycolor = Math.random() < 0.5 ? 'w' : 'b';
- if (this.mycolor == 'b')
+ this.mycolor = color || (Math.random() < 0.5 ? 'w' : 'b');
+ if (!continuation)
+ this.setStorage(); //store game state
+ if (this.mycolor != this.vr.turn)
this.playComputerMove();
}
//else: against a (IRL) friend or problem solving: nothing more to do