Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linked to correct css filename #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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