diff options
| author | Jakob L. Kreuze <jakob@memeware.net> | 2018-10-21 16:07:50 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <jakob@memeware.net> | 2018-10-21 16:07:50 -0400 |
| commit | fdf869cdddf66b1c1cb27380e157d580a5e3fb82 (patch) | |
| tree | 1cf24542a9dcfd73c64bf9a73512457b600b579c /wrap.fnl | |
| parent | 069c31331795e6501fda64ef4bf1d15771a43cfd (diff) | |
Initial movement etc
Diffstat (limited to 'wrap.fnl')
| -rw-r--r-- | wrap.fnl | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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)) |