Code: Select all
timer = "0"
timer = timer + dt
if timer >= 10 then
love.event.quit()
end
Code: Select all
timer = "0"
timer = timer + dt
if timer >= 10 then
love.event.quit()
end
Seth144k wrote: ↑Wed Jan 19, 2022 8:50 pm I figured out how to get working the timer using this:this makes a timer but it shows milliseconds also so how can i hide or not show them?Code: Select all
timer = "0" timer = timer + dt if timer >= 10 then love.event.quit() end
Code: Select all
-- init:
timer = 0 -- not "0"
-- update:
timer = timer + dt
-- draw:
love.graphics.print (math.floor(timer))
-- or
love.graphics.print (string.format("%.0f", timer))
Code: Select all
print ( string.format ( "%d", 1010.1111 ) ) -- prints string 1010
print ( string.format ( "%i", 1010.1111 ) ) -- prints string 1010
Users browsing this forum: Google [Bot] and 4 guests