CSY1018-assignment-2/scripts/launch.js

15 lines
421 B
JavaScript

/*Add events to webpage*/
function loadScripts() {
document.addEventListener("keydown", getKey)
document.addEventListener("keyup", stop)
setInterval(move, 10);
document.getElementById("start").addEventListener("click", startGame)
}
function startGame() {
var button = document.getElementById("start");
button.style.display = "none";
}
document.addEventListener("DOMContentLoaded", loadScripts);