Looks like im doing something wrong trying to do animations using time calculated by the stopwatch class
quick code:
Stopwatch timer;
void Update()
{
timer.Stop();
world.Render(timer.Milliseconds);
timer = Systems.Diagnostics.Stopwatch.StartNew();
} // end rendering
in my world render I do the following
void Render (Long Milliseconds)
{
elapsed += Milliseconds;
if (elapsed >= anim_speed)
{
elapsed = 0;
current_frame++;
current_frame %= num_frames;
}
render(current_frame);
}
with this im not having consistent animations (jerkiness all over the place) so I was wondering what should I do to improve the situation?
Popular Topics
Advertisement