about summary refs log tree commit diff stats
path: root/html/broughlike/config.js
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-12-02 17:36:06 -0500
committerelioat <elioat@tilde.institute>2024-12-02 17:36:06 -0500
commita87edf73a4ea72e857378e0c0626cc180009f700 (patch)
tree9b5229730e1e2a35606eaae32538732874ef3729 /html/broughlike/config.js
parentecff6d35e51ee35dfb34df03acdc9ceb244f7204 (diff)
downloadtour-a87edf73a4ea72e857378e0c0626cc180009f700.tar.gz
*
Diffstat (limited to 'html/broughlike/config.js')
-rw-r--r--html/broughlike/config.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/html/broughlike/config.js b/html/broughlike/config.js
index bd95035..8776b2f 100644
--- a/html/broughlike/config.js
+++ b/html/broughlike/config.js
@@ -30,3 +30,16 @@ export const CONFIG = {
     ITEMS_MAX: 3,
     DOTS_PER_HIT: 7
 };
+
+const canvas = document.getElementById('gameCanvas');
+const ctx = canvas.getContext('2d');
+const tileSize = canvas.width / CONFIG.GRID_SIZE;
+
+export const CANVAS = {
+    ctx,
+    canvas,
+    tileSize,
+    updateTileSize() {
+        return canvas.width / CONFIG.GRID_SIZE;
+    }
+};