Usage example for timer?
Usage example for timer?
For example, I have an explosion animation for my character. It's fine. But if I want to do something when the character dies, like showing a text or image, it happens immediately. I want my explosion animation finished before anything happens. Should I use timer for this?
Re: Usage example for timer?
You can:
1. Try to write a timer for yourself. (It can be easy if you won't use it a lot, but It can be tedious and It would be much easier and time-saving to choose second way)
2. Use a timer library by kikito called cron or Hump.timer by vrld.
Cron
Cron has some useful functions like:
You can download cron.lua at github,
view tutorial here
or here.
Hump (Helper Utilities for Massive Progression):
I didn't use hump.timer yet but you can read documentation and tutorials about hump here
and download here
Hope this helps!
1. Try to write a timer for yourself. (It can be easy if you won't use it a lot, but It can be tedious and It would be much easier and time-saving to choose second way)
2. Use a timer library by kikito called cron or Hump.timer by vrld.
Cron
Cron has some useful functions like:
Code: Select all
cron.after(time, callback) will execute callback after the given amount of time
Code: Select all
cron.every(time, callback) will repeat the same action periodically
You can download cron.lua at github,
view tutorial here
or here.
Hump (Helper Utilities for Massive Progression):
I didn't use hump.timer yet but you can read documentation and tutorials about hump here
and download here
Hope this helps!
Re: Usage example for timer?
Thanks, it seems like what I needed.
Who is online
Users browsing this forum: No registered users and 9 guests