From 41925d7f28696eb9542e58a92beb775e1386fd73 Mon Sep 17 00:00:00 2001 From: elioat Date: Mon, 30 Oct 2023 20:37:37 -0400 Subject: * --- js/canvas/game.js | 8 ++++---- js/canvas/index.html | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/canvas/game.js b/js/canvas/game.js index 56a2861..04519c8 100644 --- a/js/canvas/game.js +++ b/js/canvas/game.js @@ -3,7 +3,7 @@ const canvas = document.getElementById("gameCanvas"); canvas.width = 512; canvas.height = 512; const ctx = canvas.getContext("2d"); -ctx.fillStyle = "#e0f8cf"; +ctx.fillStyle = "#E0F8CF"; ctx.fillRect(0, 0, canvas.width, canvas.height); @@ -50,11 +50,11 @@ document.addEventListener("keydown", (event) => { break; case "KeyZ": case "KeyN": - player.color = "#65ff00"; + console.log('Action A'); break; case "KeyX": case "KeyM": - player.color = player.colorAlt; + console.log('Action B'); break; } }); @@ -81,7 +81,7 @@ function gameLoop() { } // draw - ctx.fillStyle = player.color; + // ctx.fillStyle = player.color; ctx.fillRect(player.x, player.y, player.width, player.height); ctx.drawImage(playerSprite, player.x, player.y, player.width, player.height); diff --git a/js/canvas/index.html b/js/canvas/index.html index 2d887fe..1889b53 100644 --- a/js/canvas/index.html +++ b/js/canvas/index.html @@ -10,10 +10,10 @@ background-color: darkgray; } #gameCanvas { - border: 1px solid black; + border: 4px solid #E6CDF7; margin: 0 auto; display: block; - background-color: #f0f0f0; + background-color: #E0F8CF; } -- cgit 1.4.1-2-gfad0