# How to synchronize the speed of spawned object and spawning time interval?

I want a stream of enemies coming from the top of the screen one behind other in a line, with their speed (speed of the whole stream i.e. every enemy) increased over time.

When I simply increased their speed, a continuous stream of balls (which will be my enemies) is lost since objects are spawned at a fixed time interval irrespective of the varying speeds of the spawned balls.

To maintain the continuous flow of balls what I wanted is to generate balls rapidly as the speed increases. So there should be a direct relationship between spawning interval and speed of the stream.

How can I do that?

float timeBetweenSpawns = spaceBetweenBalls/ballSpeed;

This relies on your units being consistent between the three variables. So if timeBetweenSpawns is measured in seconds then the spaceBetweenBalls should be measured in world units and the ballSpeed measured in world units per second.