X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FComputerGame.vue;h=f611167da0896cab35010f7a4fc7aa27a51f4638;hp=ad56543e54524e54e97b27ea7f99e73461d2bcf6;hb=bc0b9205e41c5db0552e4ccf060b945342e36ed0;hpb=978fa11c8c9838018124a36ec14e06856d948d1e diff --git a/client/src/components/ComputerGame.vue b/client/src/components/ComputerGame.vue index ad56543e..f611167d 100644 --- a/client/src/components/ComputerGame.vue +++ b/client/src/components/ComputerGame.vue @@ -44,7 +44,11 @@ export default { setTimeout(() => { if (this.currentUrl != document.location.href) return; //page change self.$refs["basegame"].play(compMove, "received"); - self.processMove(compMove); + const animationLength = + // 250 = length of animation, 500 = delay between sub-moves + // TODO: a callback would be cleaner. + 250 + (Array.isArray(compMove) ? (compMove.length - 1) * 750 : 0); + setTimeout(() => self.processMove(compMove), animationLength); self.compThink = false; if (self.game.score != "*") // User action