Skip to content

Commit

Permalink
fix refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 15, 2024
1 parent 85d3970 commit 9516d7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions html5/js/kubeinvaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,13 +663,13 @@ window.setInterval(function draw() {
}
}

if (upPressed) {
if (globalState.get('upPressed')) {
globalState.set('spaceshipY', globalState.get('spaceshipY') - 3);
if (globalState.get('spaceshipY') < 0) {
globalState.set('spaceshipY', 0);
}
}
else if (downPressed) {
else if (globalState.get('downPressed')) {
globalState.set('spaceshipY', globalState.get('spaceshipY') + 3);
if (globalState.get('spaceshipY') + spaceshipHeight > canvas.height) {
globalState.set('spaceshipY', canvas.height - spaceshipHeight);
Expand Down

0 comments on commit 9516d7c

Please sign in to comment.