summaryrefslogtreecommitdiff
path: root/wrap.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'wrap.fnl')
-rw-r--r--wrap.fnl14
1 files changed, 10 insertions, 4 deletions
diff --git a/wrap.fnl b/wrap.fnl
index 3fe2cb1..04e6290 100644
--- a/wrap.fnl
+++ b/wrap.fnl
@@ -19,10 +19,14 @@
;;;; This module contains non-game-specific bits and mode-changing logic.
-(global canvas-width 640)
-(global canvas-height 480)
+(var scale 2)
+(local canvas-width 640)
+(local canvas-height 480)
+
+(global screen-width (math.floor (/ canvas-width scale)))
+(global screen-height (math.floor (/ canvas-height scale)))
-(local canvas (love.graphics.newCanvas 640 480))
+(local canvas (love.graphics.newCanvas canvas-width canvas-height))
(local font (love.graphics.newImageFont "art/font.png"
(.. " !\"#$%&*()*+,-./"
"0123456789"
@@ -31,7 +35,6 @@
"abcdefghijklmnopqrstuvwxyz"
"[\\]^_`{|}~")))
-(var scale 2)
(var mode (require :sandbox))
(fn set-mode [mode-name ...]
@@ -72,3 +75,6 @@
:else
(mode.keypressed key set-mode)))
+
+(fn love.keyreleased [key]
+ (mode.keyreleased key set-mode))