Skip to content

Commit

Permalink
Merge pull request #6 from nadomodan/love-11.0-update
Browse files Browse the repository at this point in the history
updated to love 11.0 love.run()
  • Loading branch information
bjornbytes authored Feb 13, 2019
2 parents a96f0b0 + 9240fa9 commit 21af4fe
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,14 @@ love.run = function()
error('love.timer is required for tick')
end

if love.math then
love.math.setRandomSeed(os.time())
end

if love.load then love.load(arg) end
if love.load then love.load(love.arg.parseGameArguments(arg), arg) end
timer.step()
local lastframe = 0

love.update(0)

while true do
timer.step()
tick.dt = timer.getDelta() * tick.timescale
tick.dt = timer.step() * tick.timescale
tick.accum = tick.accum + tick.dt
while tick.accum >= tick.rate do
tick.accum = tick.accum - tick.rate
Expand All @@ -39,7 +34,7 @@ love.run = function()
for name, a, b, c, d, e, f in love.event.poll() do
if name == 'quit' then
if not love.quit or not love.quit() then
return a
return a or 0
end
end

Expand All @@ -57,8 +52,8 @@ love.run = function()

lastframe = timer.getTime()
if graphics and graphics.isActive() then
graphics.clear(graphics.getBackgroundColor())
graphics.origin()
graphics.clear(graphics.getBackgroundColor())
tick.frame = tick.frame + 1
if love.draw then love.draw() end
graphics.present()
Expand Down

0 comments on commit 21af4fe

Please sign in to comment.