From afe39c77c4359cd009990914c011d2bdc914f57c Mon Sep 17 00:00:00 2001 From: Fredrik Jensen Date: Wed, 29 Oct 2025 01:33:40 +0100 Subject: [PATCH] update color --- src/config.js | 6 +++--- src/index.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config.js b/src/config.js index 8827d9c..b4734e2 100644 --- a/src/config.js +++ b/src/config.js @@ -1,5 +1,5 @@ - export default { + bgColor: "blue", unit: 20, dimensions: { width: 30, @@ -14,5 +14,5 @@ export default { food: { x: null, y: null, - } -}; \ No newline at end of file + }, +}; diff --git a/src/index.js b/src/index.js index 2f6a4cc..1db2e8c 100644 --- a/src/index.js +++ b/src/index.js @@ -9,7 +9,7 @@ import { import keys from "./utils/keys"; import { S, N, A, K, E } from "./utils/letters"; -const { dimensions, unit, snake, food } = config; +const { dimensions, unit, snake, food, bgColor } = config; let GAME_STARTED = false; let GAME_RUNNING; @@ -40,7 +40,7 @@ for (let i = 0; i < dimensions.height; i++) { width: `${unit}px`, height: `${unit}px`, display: "inline-block", - background: "green", + background: bgColor, }, "board" );