diff options
author | elioat <elioat@tilde.institute> | 2024-12-02 17:36:06 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2024-12-02 17:36:06 -0500 |
commit | a87edf73a4ea72e857378e0c0626cc180009f700 (patch) | |
tree | 9b5229730e1e2a35606eaae32538732874ef3729 /html/broughlike/config.js | |
parent | ecff6d35e51ee35dfb34df03acdc9ceb244f7204 (diff) | |
download | tour-a87edf73a4ea72e857378e0c0626cc180009f700.tar.gz |
*
Diffstat (limited to 'html/broughlike/config.js')
-rw-r--r-- | html/broughlike/config.js | 13 |
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; + } +}; |