Original Post
im trying to make my animation for my cObject class (2d), and because i want the animations to run at about the same speed on every computer, im going to need to do the animation frames based on time, not framerate.
so here is my advanceframe code for my animation class:
my question is, is this the right way to go about it? TimeDelta is the time between two frames. i thought of this and couldn't think of any more obvious solution. any input would be great. thanks.
----------------------
i code therefore i am.
Aero DX - Coming to a bored Monitor near you!
[edited by - Neen10do on April 27, 2003 1:33:30 AM]
//Advance Frame/////////////////
void cAnimation::AdvanceFrame(DWORD TimeDelta)
{
//Adds up Elapsed time
ElapsedTime += TimeDelta;
//Tests for next frame
if(ElapsedTime >= AnimationSpeed)
{
ElapsedTime = 0;
//Advances Frame
myXCell++;
if(myXCell >= numCols)
myXCell = 0;
}
}
////////////////////////////////