From 5473d5d303b55b06438d65c4b3abd2fc0b0f86fc Mon Sep 17 00:00:00 2001 From: equa Date: Thu, 22 Apr 2021 22:18:58 -0500 Subject: very messy music --- lib/main.fnl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/main.fnl') diff --git a/lib/main.fnl b/lib/main.fnl index 4a4de12..e88f704 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 music (require :lib.music)) (local font (require :lib.font)) (local profi (require :vendor.ProFi)) (local profi? false) @@ -12,6 +13,7 @@ ;; TODO: ^ (local hotswap-modules [:lib.player + :lib.music :lib.translation :lib.bullet :lib.cells @@ -23,6 +25,7 @@ ;; oh thats why it doesnt work lmao (fn love.load [] + (music.load) (when profi? (profi:start) (set love.frame 0)) @@ -39,7 +42,7 @@ (love.graphics.print (.. "draw: \n" x)))) (love.graphics.reset) ;; (love.graphics.setFont font.small) - (love.graphics.print (love.timer.getFPS)) + ;; (love.graphics.print (love.timer.getFPS)) ;; (love.graphics.print :soko font.big 100 100) (when true ;; debug stuff (love.graphics.print (table.concat @@ -53,6 +56,7 @@ (set v.ticks (- v.ticks 1)))))) (fn love.update [] + (music.pre-update) (when profi? (profi:startHooks) (set love.frame (+ love.frame 1)) @@ -69,10 +73,13 @@ (table.insert messages {:ticks 1 :msg (.. "update: \n" x)}))) + (music.update) (when profi? (profi:stopHooks))) (fn love.keypressed [key scancode repeat] + (when (and (= key "f") (not repeat)) + (love.window.setFullscreen (not (love.window.getFullscreen)))) (match (pcall #(state.keypressed the-state key scancode repeat)) (true x) nil (false x) (do -- cgit 1.3.0-6-gf8a5