summary refs log tree commit diff
path: root/lib/main.fnl
diff options
context:
space:
mode:
authorequa <equaa@protonmail.com>2021-04-20 18:20:05 -0500
committerequa <equaa@protonmail.com>2021-04-20 18:20:05 -0500
commitc9b60c569f2ad015f043667c44ff9f43d50ec2e5 (patch)
treef4a3bb3f363a5a3c9200bc8ee5a9eab408085a1c /lib/main.fnl
parent00af64d4e503dd82abf4657ec6fd44b0a418adb2 (diff)
death screen
Diffstat (limited to 'lib/main.fnl')
-rw-r--r--lib/main.fnl10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/main.fnl b/lib/main.fnl
index 71319b8..9af1bb8 100644
--- a/lib/main.fnl
+++ b/lib/main.fnl
@@ -2,6 +2,7 @@
 (local proto (require :lib.proto))
 (local state (require :lib.state))
 (local game (require :lib.game))
+(local font (require :lib.font))
 (local profi (require :vendor.ProFi))
 (local profi? false)
 
@@ -14,6 +15,7 @@
    :lib.bullet
    :lib.cells
    :lib.game
+   :lib.death
    :lib.main])
 
 ;; the
@@ -25,8 +27,7 @@
     (set love.frame 0))
   (love.keyboard.setKeyRepeat true)
   (global the-state (state.init game))
-  (global messages (or messages {}))
-  (print "a"))
+  (global messages (or messages {})))
 
 (fn love.draw []
   (match (pcall #(state.draw the-state))
@@ -36,7 +37,9 @@
                 (print (.. "draw \n" x))
                 (love.graphics.print (.. "draw: \n" x))))
   (love.graphics.reset)
+  ;; (love.graphics.setFont font.small)
   (love.graphics.print (love.timer.getFPS))
+  ;; (love.graphics.print :soko font.big 100 100)
   (when true ;; debug stuff
     (love.graphics.print (table.concat
                            (lume.map messages #$.msg)
@@ -58,7 +61,8 @@
       (os.exit)))
   ;; TODO: make state changes actually possible
   (match (pcall #(state.update the-state))
-    (true x) nil
+    (true next) (global the-state next)
+    (true nil) nil
     (false x) (do
                 (print (.. "update: \n" x))
                 (table.insert messages