- What did you expect to happen, where?
- What has happened instead?
- What have you tried?
[library] cron.lua - time management for LÖVE - v2.0 is out!
- 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
I am sorry but you will have to give me a little more than that.
When I write def I mean function.
Re: [library] cron.lua - time management for LÖVE - v2.0 is
1. I expected the screen to shake.
2. An error.
3. Asking you, since I don't know anything about cron.lua.
2. An error.
3. Asking you, since I don't know anything about cron.lua.
- 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
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.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [library] cron.lua - time management for LÖVE - v2.0 is
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.
Re: [library] cron.lua - time management for LÖVE - v2.0 is
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.
Re: [library] cron.lua - time management for LÖVE - v2.0 is
What would dt be in the context of a cron callback? Wouldn't it just be the interval that you specified?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.
- 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
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.
Re: [library] cron.lua - time management for LÖVE - v2.0 is
Are you wanting to pass dt through so it can be used by the function that is being triggered by the cron?
- 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
You can use a table to hold a reference to it then. For example, a player table:SiENcE wrote:Yes, the last one.
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
When I write def I mean function.
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests