To the point, is there a way to make a dynamic
timer based on FPS? Timer from Chingu often misses some crucial lines in my game (jump distance, attacking delays, etc)...
Or maybe there's another way that better but still using
timer method from Chingu?
Thanks in advance.
You can just make a global variable and increment it at beginning of every Window.update
$time = 0
$time += 1
I use it in all my games and it proves itself in many situations.
But if by dynamic timer you mean something you can reset and start over, you can add:
@timer ||= $time
if $time == @timer + your_time
@timer = nil
Okay. Figured it. That's pretty neat when just implemented in my game. Cheers!
And even I can make a event-handler for timers. (I've figured how to handle timers to get the event switch, but returns nil :p )
Now, I'm replacing timers with frame-based one rather than built-in millisecond-based.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill