diff options
author | elioat <hi@eli.li> | 2023-12-28 12:59:22 -0500 |
---|---|---|
committer | elioat <hi@eli.li> | 2023-12-28 12:59:22 -0500 |
commit | c49f8d5dde2cc34036be6ee953ffef92a688fd28 (patch) | |
tree | 053c7a0b1f7b161b3c282a3a444d4f299a9f47c7 | |
parent | 544d53097c7f220e397ab2fb2d7f7973a8ae11da (diff) | |
download | tour-c49f8d5dde2cc34036be6ee953ffef92a688fd28.tar.gz |
*
-rw-r--r-- | js/game-frame/game.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/game-frame/game.js b/js/game-frame/game.js index 3eac852..935263d 100644 --- a/js/game-frame/game.js +++ b/js/game-frame/game.js @@ -10,7 +10,7 @@ const player = { y: 0, width: 8, height: 8, - speed: 8, + step: 8, color: 'blue', spriteUrl: "chickadee.svg" }; @@ -78,16 +78,16 @@ window.addEventListener('keydown', (e) => { switch (e.key) { case 'ArrowUp': - newY -= player.speed; + newY -= player.step; break; case 'ArrowDown': - newY += player.speed; + newY += player.step; break; case 'ArrowLeft': - newX -= player.speed; + newX -= player.step; break; case 'ArrowRight': - newX += player.speed; + newX += player.step; break; } |