Fix ambient not playing
This commit is contained in:
parent
d746854307
commit
db2c4579b6
4 changed files with 28 additions and 16 deletions
|
|
@ -108,7 +108,16 @@ const main = async () => {
|
|||
let game: Game;
|
||||
|
||||
const firstClickListener = () => {
|
||||
SoundHandler.initialize();
|
||||
SoundHandler.initialize(
|
||||
() => {
|
||||
enableMusic.checked = true;
|
||||
enableMusic.dispatchEvent(new Event('change'));
|
||||
},
|
||||
() => {
|
||||
enableMusic.checked = false;
|
||||
enableMusic.dispatchEvent(new Event('change'));
|
||||
},
|
||||
);
|
||||
document.removeEventListener('click', firstClickListener);
|
||||
};
|
||||
document.addEventListener('click', firstClickListener);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue