Make more enemies spawn over time?

Get help using Construct 2

Post » Sat May 18, 2013 4:45 pm

Hi Everyone, I'm trying to put together a simple "stay alive as long as possible" style game.

I've made a set of enemies spawn outside the layout and move across the screen, the players goal is to avoid the enemies. My problem I have is I have no idea how to make the enemies go from spawning a random amount every second to after 20/30 seconds change this to spawning a random amount every 0.5 seconds.

I'd then like to be able to keep speeding the spawn rates up every 20/30 seconds or so.

Is something like this possible to do? Here's a screenshot of what i've put together, (probably completely wrong).
http://i.imgur.com/vpVuOL2.png

Any tips to make this happen would be great!

B
3
Posts: 3
Reputation: 181

Post » Sat May 18, 2013 5:15 pm

every 20 seconds set TIME_VAR(global variable)

spawn enemy every TIME_VAR
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Sat May 18, 2013 5:16 pm

[QUOTE=zaimoku01] Hi Everyone, I'm trying to put together a simple "stay alive as long as possible" style game.

I've made a set of enemies spawn outside the layout and move across the screen, the players goal is to avoid the enemies. My problem I have is I have no idea how to make the enemies go from spawning a random amount every second to after 20/30 seconds change this to spawning a random amount every 0.5 seconds.

I'd then like to be able to keep speeding the spawn rates up every 20/30 seconds or so.

Is something like this possible to do? Here's a screenshot of what i've put together, (probably completely wrong).
http://i.imgur.com/vpVuOL2.png

Any tips to make this happen would be great!

[/QUOTE]

A good way to do it would be to firstly have two global variables;

interval
respawnRate

So, every "interval" seconds, you decrease "respawnRate", which stores your enemy spawn rate.



Can you apply something like that to your situation?
B
3
Posts: 23
Reputation: 221

Post » Sat May 18, 2013 5:40 pm

exactly what i meant
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Sat May 18, 2013 6:07 pm

[QUOTE=yonda] exactly what i meant [/QUOTE]

I completely agree. It was just that by the time I wrote up my reply, you'd already beaten me to it.
B
3
Posts: 23
Reputation: 221

Post » Sat May 18, 2013 6:13 pm

no problem you got even an example for him
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Sat May 18, 2013 8:19 pm

Thanks for your replies, you've all been super helpful. I'll give this a go and let you know how I get on.
B
3
Posts: 3
Reputation: 181

Post » Sat May 18, 2013 9:53 pm

This worked perfectly, does exactly what I wanted it to. One last thing, is there a way to add a condition onto the end so that when my spawnrate gets to a certain speed it locks at that speed, avoiding it quickening the spawn rate endlessly?

Thanks again for all your help
B
3
Posts: 3
Reputation: 181

Post » Sat May 18, 2013 10:23 pm

What you could do is add an event that compares two variables, and then make lowering your respawn rate conditional on its value being more than x;



I'd be interested to know if there's another way to do it, though. Perhaps with the While plugin, although I haven't used that myself yet, so I'm not 100% sure on how it functions.

Edit: Corrected my image. The second condition didn't need to be a sub-event.Nullus2013-05-18 23:41:40
B
3
Posts: 23
Reputation: 221


Return to How do I....?

Who is online

Users browsing this forum: gregorysforster, jeffige, Matthew de and 1 guest