2022-04-28 15:49:09 +00:00
|
|
|
/*Add events to webpage*/
|
|
|
|
|
|
|
|
|
|
function loadScripts() {
|
2022-04-28 16:58:53 +00:00
|
|
|
document.addEventListener("keydown", getKey)
|
2022-04-28 15:49:09 +00:00
|
|
|
document.addEventListener("keyup", stop)
|
2022-04-28 16:58:53 +00:00
|
|
|
setInterval(move, 10);
|
2022-04-28 15:49:09 +00:00
|
|
|
document.getElementById("start").addEventListener("click", startGame)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function startGame() {
|
|
|
|
|
var button = document.getElementById("start");
|
|
|
|
|
button.style.display = "none";
|
|
|
|
|
}
|
|
|
|
|
document.addEventListener("DOMContentLoaded", loadScripts);
|