projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some fixes + draft newmove pingback logic (unfinished, not working)
[vchess.git]
/
client
/
src
/
components
/
ComputerGame.vue
diff --git
a/client/src/components/ComputerGame.vue
b/client/src/components/ComputerGame.vue
index
aee1f70
..
5782ba6
100644
(file)
--- a/
client/src/components/ComputerGame.vue
+++ b/
client/src/components/ComputerGame.vue
@@
-38,7
+38,8
@@
export default {
this.compWorker.onmessage = e => {
let compMove = e.data;
// Small delay for the bot to appear "more human"
this.compWorker.onmessage = e => {
let compMove = e.data;
// Small delay for the bot to appear "more human"
- const delay = Math.max(500 - (Date.now() - this.timeStart), 0);
+ const minDelay = this.gameInfo.mode == "versus" ? 500 : 1000;
+ const delay = Math.max(minDelay - (Date.now() - this.timeStart), 0);
let self = this;
setTimeout(() => {
if (this.currentUrl != document.location.href) return; //page change
let self = this;
setTimeout(() => {
if (this.currentUrl != document.location.href) return; //page change
@@
-57,7
+58,7
@@
export default {
if (!game) {
game = {
vname: this.gameInfo.vname,
if (!game) {
game = {
vname: this.gameInfo.vname,
- fenStart: V.GenRandInitFen(),
+ fenStart: V.GenRandInitFen(
this.st.settings.randomness
),
moves: []
};
game.fen = game.fenStart;
moves: []
};
game.fen = game.fenStart;