How do I Change Spawning Time

Get help using Construct 2

Post » Sun Mar 22, 2015 5:31 am

My game has enemies that spawn ever 'random(5,8)seconds', but every 10 seconds I want the spawning rate to reduce to 'random(4,7)seconds' for example. How would I go about doing this?
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Sun Mar 22, 2015 6:56 am

easy... add a variable (local or global), for example 'x'. every 10 secs add 1 to x.
insert x to the spawn event:
random(5-x,8-x) seconds.

Of course you need to limit the x, so it wont be subtracted forever.
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Mon Mar 23, 2015 1:05 am

How do i create the limitation?
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Mon Mar 23, 2015 3:20 am

you can use:
while x <5
add 1 to x
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Mon Mar 23, 2015 2:26 pm

Thanks so much!
B
8
S
2
Posts: 146
Reputation: 1,132


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests