Allegro timers are laggy?
I'm using ALLEGRO_TIMER objects for my Object class. So every object will have a timer in order to control animation frames. But i am suspicious if too many allegro timers lag the game ? Should I use it ?
I think they should be fairly efficient. Just make sure that you handle the timer events as soon as you possibly can. Try not to let them pile up.
On each timer tick, i set the tick count 0 (so i can check it easily again).
for (int i=0;i<Objects.size();i++)
Thread #606243. Printed from Allegro.cc
Why do you need a separate timer for each of your objects? A single 60hz timer should be sufficient for most everything. All you have to do is track delta time in your animated object and set the frame number accordingly.
frame_num = (int)(frametime*frames_per_sec);
// check bounds of frame_num here...