From a87edf73a4ea72e857378e0c0626cc180009f700 Mon Sep 17 00:00:00 2001 From: elioat Date: Mon, 2 Dec 2024 17:36:06 -0500 Subject: * --- html/broughlike/config.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'html/broughlike/config.js') 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; + } +}; -- cgit 1.4.1-2-gfad0