Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Best way to do time-based animation with Box2d — Gideros Forum

Best way to do time-based animation with Box2d

zvardinzvardin Member
edited December 2012 in General questions
This is probably a simple question, but I noticed world:step() is supposed to use a consistent variable (1/60 usually). I'm curious what is the best way to take into account some devices may run at 60 fps, while others may run a bit slower. To keep this in mind, I figured time-based code would be best, so regardless of your fps everything happens within the same amount of time. This made me wonder how I should approach this and all I can think of is keeping track of how many steps have been made and keep track of total time run and then make as many steps as needed each frame to keep up related to the time.

Does that sound about right, or is there a better way to handle this? Thanks!

Likes: gianmichele

+1 -1 (+1 / -0 )Share on Facebook

Comments

Sign In or Register to comment.