Hi Jason
Why do you complicate using clock instead of a 'counter' variable? And why a constant interval to add the asteroids to the vector?
I have never used a clock in my poor SFML projects, nor know if they exist in SFML.Net
I give you a suggestion, you can take it or not
DateTime time
= DateTime
.Now;rand
= new Random
();int waiter
= 0;while (true) // game loop{ time
= time
.AddMilliseconds(20); // that is 50FPS if (waiter
> 0) waiter
--; else if (waiter
== 0) { asteroids
.Add(new Asteroid
( .... )); waiter
= rand
.Next(50,
150); // or whatever you want } DrawAsteroids
(); // whatever it is implemented while (DateTime
.Now < time
) ; // wait for the 20ms } Hope this helps. Feel free to ask whatever you need.
PS: Maybe someone could translate to C++?