Original Post
I am using directx 8 to write my own sprite engine. But I have just one issue to work out and that is animation. I can load an animation sequence and draw it to the screen, the only problem is that it draws each frame on top of the other.
For example:
int explode[5] = { 1,2,3,4,5}; // animation sequence
ship2.Update();
ship2.RenderAnimation(g_pBackSurface, 5, explode);
Well, as you can imagine, this draws 5 explosions on top of each other! So my question is, how to I hide the frame before the next one is drawn?
Here is the animation function:
CSprite::RenderAnimation( LPDIRECT3DSURFACE8 pDestSurface, int numAnimations, int *data)
{
RECT SourceRect = { 0, 0, m_SpriteWidth, m_SpriteHeight };
POINT DestPoint = { m_x, m_y };
for(int num=0; num