[library] cron.lua - time management for LÖVE - v2.0 is out!

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: [library] cron.lua - time management for LÖVE - v2.0 is

Post by kikito »

I am sorry but you will have to give me a little more than that.
  • What did you expect to happen, where?
  • What has happened instead?
  • What have you tried?
When I write def I mean function.
User avatar
Kasperelo
Party member
Posts: 343
Joined: Fri Apr 13, 2012 1:47 pm
Location: The Milky Way

Re: [library] cron.lua - time management for LÖVE - v2.0 is

Post by Kasperelo »

1. I expected the screen to shake.
2. An error.
3. Asking you, since I don't know anything about cron.lua.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: [library] cron.lua - time management for LÖVE - v2.0 is

Post by kikito »

I am sorry but I don't have time to dig through your code right now - especially with so little direction. Perhaps others in the community will want to step in.
When I write def I mean function.
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: [library] cron.lua - time management for LÖVE - v2.0 is

Post by Jasoco »

I don't think the problem lies with cron. I suspect it's a defective shake function. Have you tried testing to make sure the shake works by itself? Attach it to a key press for testing.
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: [library] cron.lua - time management for LÖVE - v2.0 is

Post by SiENcE »

Is it possible to get access to dt in the callback function? When I look at the code, only args are passed, but not dt.
User avatar
Tanner
Party member
Posts: 166
Joined: Tue Apr 10, 2012 1:51 am

Re: [library] cron.lua - time management for LÖVE - v2.0 is

Post by Tanner »

SiENcE wrote:Is it possible to get access to dt in the callback function? When I look at the code, only args are passed, but not dt.
What would dt be in the context of a cron callback? Wouldn't it just be the interval that you specified?
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: [library] cron.lua - time management for LÖVE - v2.0 is

Post by kikito »

The callback is invoked after many dts. Which one would you pass to the callback? The last one?
When I write def I mean function.
Rockford
Prole
Posts: 26
Joined: Fri Mar 14, 2014 9:40 pm
Location: USA

Re: [library] cron.lua - time management for LÖVE - v2.0 is

Post by Rockford »

Are you wanting to pass dt through so it can be used by the function that is being triggered by the cron?
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: [library] cron.lua - time management for LÖVE - v2.0 is

Post by kikito »

SiENcE wrote:Yes, the last one.
You can use a table to hold a reference to it then. For example, a player table:

Code: Select all

local clock = cron.after(5, function()
  print(player.last_dt)
end)

...

function love.update(dt)
  player.last_dt = dt
  clock:update(dt)
end
The only other option I can think of is overriding clock.update yourself to use dt.
When I write def I mean function.
Post Reply

Who is online

Users browsing this forum: No registered users and 206 guests