Skip to content

Commit fec2c43

Browse files
committed
animation fixes
1 parent dac887e commit fec2c43

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/main.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ var game = new engine();
2626
const board = new Chessboard(document.getElementById("board"), {
2727
position: game.getFEN(),
2828
sprite: { url: "../assets/images/chessboard-sprite-staunty.svg" },
29+
animationDuration: 200,
2930
});
3031

3132
updateStatus();
@@ -52,10 +53,9 @@ function inputHandler(event) {
5253
this.chessboard.setPosition(game.getFEN(), true).then(() => {
5354
event.chessboard.enableMoveInput(inputHandler);
5455
setTimeout(() => {
55-
// updateStatus();
5656
game.makeAIMove();
5757
this.chessboard.setPosition(game.getFEN(), true);
58-
updateStatus();
58+
setTimeout(() => updateStatus(), 300);
5959
}, 500);
6060
});
6161
});
@@ -107,6 +107,7 @@ makeMove.addEventListener("click", () => {
107107
setTimeout(() => {
108108
game.makeAIMove();
109109
board.setPosition(game.getFEN(), true);
110+
event.chessboard.enableMoveInput(inputHandler);
110111
}, 500);
111112
updateStatus();
112113
});

0 commit comments

Comments
 (0)