Help with a Timer, Double, and Int [Solved]
Posted: Mon Dec 14, 2015 9:55 pm
Hello! I am very new to LÖVE, and I am having a little bit of trouble with a timer I am trying to make.
Here is my code:
When I print the timer in the love.draw function, on the screen it appears as a massive double!
Does anyone know/have any idea on how to make the timer just single seconds, or is that impossible?
Please help! Thank you!
-Dopplespots
Here is my code:
Code: Select all
IntroTimer = true
StartTimer = 0
function love.load()
Mainfont = love.graphics.newFont("Graphics/PixelFont.ttf", 22)
love.graphics.setBackgroundColor(255, 255, 255)
love.graphics.setColor(0, 0, 0)
love.graphics.setFont(Mainfont)
end
function love.update(dt)
if IntroTimer then
StartTimer = StartTimer + dt
end
end
function love.draw()
love.graphics.printf("Hey.", 20, 250, 458, "center")
love.graphics.printf(StartTimer, 10, 10, 300, "left")
end
Does anyone know/have any idea on how to make the timer just single seconds, or is that impossible?
Please help! Thank you!
-Dopplespots