Math problem - spawning every ... seconds
Hi guys,
I have a tapping game that has 10 levels, each 30 seconds long on a timer. To achieve progressive difficulty I have increased the rate of spawning, (ie. every .5 seconds, every .45 seconds, etc.), and increased the number able to be spawned for each level.
I think my math is wrong cuz when I reach 50 actors spawned at a rate of .55 seconds each the level won't complete. Level complete is when all actors are destroyed in time limit (30 secs).
In the next level the spawning rate is .50 and the number of actors is 55 spawned in 30 seconds.
The next level the spawning rate is .475 and the number of actors is 60 spawned in 30 seconds.
What equation should I be using to make sure all actors are able to be tapped in time? Also is there a buffer I should use in either the number of actors or spawning rate to make sure the player can complete a level?
Thanks,
Bill
I have a tapping game that has 10 levels, each 30 seconds long on a timer. To achieve progressive difficulty I have increased the rate of spawning, (ie. every .5 seconds, every .45 seconds, etc.), and increased the number able to be spawned for each level.
I think my math is wrong cuz when I reach 50 actors spawned at a rate of .55 seconds each the level won't complete. Level complete is when all actors are destroyed in time limit (30 secs).
In the next level the spawning rate is .50 and the number of actors is 55 spawned in 30 seconds.
The next level the spawning rate is .475 and the number of actors is 60 spawned in 30 seconds.
What equation should I be using to make sure all actors are able to be tapped in time? Also is there a buffer I should use in either the number of actors or spawning rate to make sure the player can complete a level?
Thanks,
Bill
Comments
Example: on touch,
Change attribute self.position.x to random 20,460
Change attribute self.position.y to random 20,300
Change attribute game.score to game.score+1
This way you don't need but the 30 second timer. Each time they press and actor the actor instantly moves to a new location, but gives the appearance it was destroyed and renowned elsewhere. It also does not restrict your player and they can complete the level quickly.
Could someone help with my math?
Bill
If they were simple number .5 each level you could try;
(6 - (game.level*.5))*0.1
That will give you a consistent set of time (level 1 = .55, level 5 = .25, etc).
But since you have that .475 in their that throws things off. If you want to do that then I'd just edit each individual spawning actor in each level (in the scene editor) and put in the time that you want.