Random Spawn Intervals

Get help using Construct 2

Post » Mon Nov 26, 2012 10:39 pm

How do I make a sprite spawn a zombie at a random interval?
Like, it randomly picks a number, for example 6, waits 6 seconds, spawns a zombie, it randomly picks a number again, for example 3, waits 3 seconds, spawns a zombie, etc. etc..
How would I go about doing that?
Posts: 366
Reputation: 6,252

Post » Mon Nov 26, 2012 11:43 pm

Click on the System command 'Every X seconds', and use the syntax "random(10)" for a max interval of 10 seconds.

Then the action would be System, Create Object, and fill in the layer and x,y co-ords
Using R243 for all examples
Posts: 378
Reputation: 9,672

Post » Fri Apr 12, 2013 10:54 pm

Using this post, and because I need something similar but I cant find the right logic:

How do I make a random spawn of 4 numbers in 4 different but fixed positions without repeating themselves?
In other way I want them to spawn in a,b,c and d positions randomly but never overlapping.

I found a rudimentary way with a "set position" x=CHOOSE(128,384,640,896) and every time they overlap its forced to choose another place to be. This repeats 4 times for each number. It works but it seems very badly done. It brings me further problems when I want 10 numbers in 10 random fixed positions... its huge!

I have this feeling that this is done with an array, but I don't know how to use it here.
Posts: 4
Reputation: 708

Return to How do I....?

Who is online

Users browsing this forum: Emac, imhotep22, kiko2015, Monkin8r and 10 guests