Thanks for coming by to this thread.
Anyways, my problem is, i am developing a shoot em up game, and i have already got the bullets, spaceship etc moving around.
My problem is with the enemies, I can draw many onto the screen, but i don't want a lot of enemies popping around
I use vector container to store the enemies.
while(running)
{
PastFrames = SDL_GetTicks() - beginTime;
beginTime = SDL_GetTicks();
if( PastFrames < PerFrames )
{
SDL_Delay( PerFrames - PastFrames );
int myrand = rand()%30+1;
if( myrand == 1 )
{
Asteroid myAsteroid;
Asteroids.push_back(myAsteroid);
}
}
}
This works a bit, But is there any other efficient way to do this, I cant figure it out, Any possible way is suitable for me.
Thanks in advance!