it gives me the error, "Error, main.lua.18: bad argument #1 to 'print' (string expected, got nil)". If anyone has anything that could help me, that would be awesome.
You're missing a few variables, you're not defining where on the screen you want to print that, and you must not have defined what timer is, because it is say it is "nil", or nothing
To print it correctly, you should do love.graphics.print(timer, 256, 512)
The 256 and 512 are the X and Y coordinates, they can be anything you want (inside of the screen's Width and Height, of course)
One more question, when my timer hits, 14.5, I have it set to 0 and then start again but I want it to keep going up to 14.5 and then going back to 0 and starting again, any help? I currently have this code
function love.load()
timer = 0
goingup = true
MAX_TIMER = 14.5
end
function love.update(dt)
if goingup then
timer = timer + dt
if timer >= MAX_TIMER then
timer = MAX_TIMER
goingup = false
end
else
timer = timer - dt
if timer <= 0 then
timer = 0
goingup = true
end
end
-- ...
end