-
- // TEMPORARY: DEBUG (duplicate code)
- play: function(move) {
- // Not programmatic, or animation is over
- if (!move.notation)
- move.notation = this.vr.getNotation(move);
- this.vr.play(move);
- if (!move.fen)
- move.fen = this.vr.getFen();
- if (this.sound == 2)
- new Audio("/sounds/move.mp3").play().catch(err => {});
- // Is opponent in check?
- this.incheck = this.vr.getCheckSquares(this.vr.turn);
- const score = this.vr.getCurrentScore();
- },
- undo: function(move) {
- this.vr.undo(move);
- if (this.sound == 2)
- new Audio("/sounds/undo.mp3").play().catch(err => {});
- this.incheck = this.vr.getCheckSquares(this.vr.turn);
- },