Win sound

This commit is contained in:
0880
2026-01-21 11:29:25 +03:30
parent 694ccc14a4
commit ded7da8e73

View File

@@ -141,11 +141,12 @@
const textures = {};
const piecemoveSound = new Audio("/static/piecemove.mp3");
//const endgameSound = new Audio("/static/endgame.mp3");
const endgameSound = new Audio("/static/endgame.mp3");
let color = 0;
let turn = 0;
let state = -1;
let oldState = -1;
let start_time = undefined;
let ready = false;
let letterMap = ' ';
@@ -187,7 +188,11 @@
.catch(error => {
console.error("Playback failed:", error);
});
if (oldState !== state && state >= 1) {
endgameSound.play();
}
oldBoard = structuredClone(board);
oldState = state;
}
}