Hello,
I want to have more objects spawn over the course of gameplay time.
I have a scene variable called “spawnTimer” with an initial value of 1.
The event I put subtrack in the scene variable does not work.
Any help would be greatly appreciated.
Can you explain how it does not work? Does the object not get created? Does it not move? Does it only get spawned once, and then never again? Or something else?
What’s the value of spawn_speed?
1st event is to display text for how many times it is repeating
2nd event deletes bg object if it gets below bottom of screen
3rd event is using compare two numbers in condition
To check looped TimeFromStart() around 0.5 (so it goes from 0 to 0.5 then reset back to 0 and again to 0.5) is greater than 0.2
4th event which is sub event and repeat type event
Repeats 2 times + whatever round Increase variable value have and it rounds it
If value is below 0.5 it will round it to 0 integer if its above 0.5 it rounds it to 1
And since we are adding to Increase variable 0.2
its first 0.2 then 0.4 then 0.6 then 0.8 then 1
So thx to round it looks like
2 + 0.2 0.4 0.6 0.8 1
2 + _0 _0 __1 _1 _1
So next would be
2+ 1.2 then + 1.4 and so go on
And in action we create objects randomly from left to right camera border with margin on the right -20 so they don’t go off screen
We are adding force to objects so they fly down
And last event is just adding 0.2 to Increase variable so it keep increasing as time goes
You do realise that after 1/2 a second spawn_speed will be 0?
If you add up all the TimeDelta() values over 1 second, it add to 1. So over 1/2 a second it’ll be 0.5
2 * 0.5 = 1, so after 1/2 a second spawn_speed wil bave been decreased by 1, meaning it’ll have a value of 0.
I don’t understand, is that an add rather than a subtract?
Neither. After 1/2 second, taking off 2 * TimeDelta()
from spawn_speed will result in spawn_speed being 0. So the timer event will action every game frame.
Read the wiki entry on TimeDelta() for more details.