I'm pretty new to LÖVE and lua. I know the love.timer.getTime() command but I'm trieng to build my own League of Legends Jungletimer, that counts down from 5:00 minutes and stops at 0:00.
I looked up, how to do a simple Timer that ticks down.
Code: Select all
function timerdownblueb()
bluebtimer = true
local currentTime = love.timer.getTime()
local timeDelta = math.floor(currentTime - initTime ) -- initTime is a variable loaded in love.load()
currentNumbersecbb = 59 - timeDelta -- let's the second tick down
currentNumberminbb = 4
if currentNumbersecbb < 1 and currentNumberminbb < 1 then -- checks, if the countdown is 0:00 and stops displaying the timer with bluebtimer =false
bluebtimer = false
elseif currentNumbersecbb < 1 then -- this is to let minutes tick down and let the seconds start again
currentNumberminbb = currentNumberminbb - 1
currentNumbersecbb = 59- timeDelta -- I tried to let the seconds start over again here.. but it doesn't seem to work...
end
end
I copied this with different variables for the other jungle buffs in league of legends and wanted to start it with a different Button.
My problem now is that if i start a countdown, the other countdown won't start at 5:00 but at the same time the other countdown is right now. for an example: if one timer is at 4:30 and i start another timer it starts at 4:30 and not 5:00
Ok, what im asking now is, if someone could help me and show me a way to have more than one resetable countdown that will reset itself after its duration and is startable again afterwards. And maybe even a way to programm clickable areas.
I can give you a .love file too, if it's needed.
Thank you very much in advance