我的按钮有问题。如果按钮没有被点击,我想继续播放我的开场声;否则暂停声音并加载游戏。我怎样才能做到这一点?到目前为止,我已经尝试过了,但无济于事。
function showStartScreen(launch) {
//SHOW SPLASH SCREEN
var screen = document.getElementById("splash");
removeClass(screen, SPLASHSTATES.SPLASH_OFF);
addClass(screen, SPLASHSTATES.SPLASH_ON);
if(document.getElementById('startButton').click = false){
playSound(sndOpening);
}
else{
//CONFIGURE START BUTTON
var start = document.getElementById("startButton");
if (launch) {
start.innerText = "Start Game";
stopSound(sndOpening);
start.addEventListener("click", loadGame, false);
} else {
start.innerText = "Resume Game";
start.addEventListener("click", reloadGame, false);
}
} // end of outer if-else
//ANIMATE SPLASH SHOW
animatePanel(splash);
}
任何帮助表示赞赏。谢谢