Timer = {startTime=love.timer.getDelta( ),timeElapsed=0,timeFireSecs=0} function Timer:new (o) o = o or {} setmetatable(o, self) self.__index = self return o end function Timer:setParams (timeFireSecs) self.timeFireSecs = timeFireSecs end function Timer:reset () self.timeElapsed = 0 self.starTime = love.timer.getDelta( ) end function Timer:checkTime () local curDelta = love.timer.getDelta( ) self.timeElapsed = self.timeElapsed + curDelta if self.timeElapsed >= self.timeFireSecs then self:reset() return true else return false end end