about summary refs log tree commit diff stats
path: root/html/broughlike/config.js
diff options
context:
space:
mode:
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;
+    }
+};