Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
alert("Click to OK start game");
const grid = document.querySelector('.grid')
const resultsDisplay = document.querySelector('.results')
let currentShooterIndex = 202
Expand Down Expand Up @@ -103,6 +104,12 @@ function shoot(e) {
let laserId
let currentLaserIndex = currentShooterIndex
function moveLaser() {

if (currentLaserIndex - width < 0) {
squares[currentLaserIndex].classList.remove("laser");
return;
} else {

squares[currentLaserIndex].classList.remove('laser')
currentLaserIndex -= width
squares[currentLaserIndex].classList.add('laser')
Expand All @@ -121,8 +128,8 @@ function shoot(e) {
resultsDisplay.innerHTML = results
console.log(aliensRemoved)

}
}

}
switch(e.key) {
case 'ArrowUp':
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8">

<title>Space Invaders</title>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="style.css">

</head>
<body>
Expand Down