melee-roguelite/mode-intro.fnl

23 lines
674 B
Plaintext
Raw Normal View History

(import-macros {: incf} :sample-macros)
2018-10-17 18:32:39 -07:00
(var counter 0)
(var time 0)
2022-03-10 12:29:30 -08:00
(love.graphics.setNewFont 30)
2018-10-17 18:32:39 -07:00
{:draw (fn draw [message]
2022-03-10 12:29:30 -08:00
(local (w h _flags) (love.window.getMode))
(love.graphics.printf
(: "This window should close in %0.1f seconds"
:format (math.max 0 (- 3 time)))
0 (- (/ h 2) 15) w :center))
2018-10-17 18:32:39 -07:00
:update (fn update [dt set-mode]
(if (< counter 65535)
(set counter (+ counter 1))
(set counter 0))
(incf time dt)
2018-10-17 18:32:39 -07:00
(when (> time 3)
(love.event.quit)))
:keypressed (fn keypressed [key set-mode]
(love.event.quit))}