fix critical timer typo and make timer work

This commit is contained in:
2026-09-22 15:48:33 -06:00
parent 2e1325c429
commit d1eaff6d96
2 changed files with 15 additions and 6 deletions
+13 -5
View File
@@ -1,15 +1,23 @@
local utility = require "lib.utility"
local progress_bar = require "lib.progress_bar"
local timer = require "lib.timer"
local utility = require "lib.utility"
-- test progress_bar
local window_width, window_height = love.graphics.getDimensions()
local progress_bar_height = 30 -- TODO should not be hardcoded
local test = progress_bar(0, window_height - progress_bar_height, window_width, progress_bar_height)
test:set_text("This is a test text string of significant length. It exists to test printing over a progress bar.")
test:set_progress(math.random())
local test_bar = progress_bar(0, window_height - progress_bar_height, window_width, progress_bar_height)
test_bar:set_text("This is a test text string of significant length. It exists to test printing over a progress bar.")
-- test:set_progress(math.random())
local test_timer = timer.every(1, function() end) -- TODO consider making timer not need a function; cause I don't here!
love.update = function(dt)
timer.update(dt)
test_bar:set_progress(test_timer.run_time)
end
love.draw = function()
test:draw()
test_bar:draw()
end
love.keypressed = function(key)