Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 494 Bytes

timer.md

File metadata and controls

31 lines (23 loc) · 494 Bytes

shard.timer

Extremely simple timer

local Timer = require("shard.timer")

Timer:new(duration, callback) / Timer(duration, callback)

Creates new timer with duration and callback function

Timer:update(deltaTime)

Updates timer based on delta time

Example

local Timer = require("shard/timer")

function timerCallback()
  print("tick")
end

local timer

function love.load()
  timer = Timer(2.25, timerCallback)
end

function love.update(dt)
  timer:update(dt)
end