Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iLikeGrape committed Nov 19, 2024
1 parent 4e503d3 commit 039dd76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spaceinvaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ window.onload = function() { //when game starts
}

requestAnimationFrame(update);
document.addEventListener("Keydown", moveShip())
document.addEventListener("Keydown", moveShip);
}
function update(){
//preping for next frame
Expand All @@ -51,7 +51,7 @@ function update(){

}

function moveShip() {
function moveShip(e) {
if (e.code == "ArrowLeft") { // checks to see if it should move left
if (e.code == "ArrowRight"){

Expand Down

0 comments on commit 039dd76

Please sign in to comment.