$life.textContent = life;
if (life === 0) {
clearInterval(timerId);
clearInterval(tickId);
setTimeout(() => {
alert(`게임오버! ${score}점입니다.`);
}, 50);
}
});
});
$life.textContent = life;
if (life === 0) {
clearInterval(timerId);
clearInterval(tickId);
setTimeout(() => {
alert(`게임오버! ${score}점입니다.`);
}, 50);
}
});
});