this is how i handled it.... worked on multiple computers with different processor speeds.
if (Enemy.State[i] == EXPLODING)
{
if (ExplodeCount[1] < 38)
{
dbPlaySprite ( 7, 1, 16, 50 );
dbSprite ( 7, Enemy.X[i], Enemy.Y[i], 7 );
dbShowSprite(7);
ExplodeCount[1]++;
}
else
{
dbHideSprite(7);
ExplodeCount[1] = 0;
Enemy.State[i] = DEAD;
dbSetSpriteFrame(7, 1);
}
}
Only thing is you have to run it a few times to get the right number of loops.
Saving the world, one bit at a time.... Wait it's not worth saving. Get your own bits!