How do I - spawn a random object at a random spawn location

Get help using Construct 2

Post » Mon May 12, 2014 9:27 pm

Hey guys,

I'm in need of a little help! Does anyone know or can point me in the right direction, I'm looking to spawn a random sprite object at a random spawner location so to put this in context;

I have a row of spawners in a layout, and a number of different sprite objects, what I'm wanting to do is every x secs, pick one of the objects at random, and then spawn that object at one of the spawner location which is also picked at random.

Humm, I'm going around in circles at the moment so any help would be very much appreciated!

Cheers!!
B
4
Posts: 7
Reputation: 239

Post » Mon May 12, 2014 9:37 pm

I had The same question and went and read The family chapter un The manual. If you put them all in a family and Then set The event create objet and select Thefamily as The object it will Take a random object from The family and créate it.
B
7
S
1
Posts: 23
Reputation: 478

Post » Mon May 12, 2014 9:54 pm

chewienator wrote:I had The same question and went and read The family chapter un The manual. If you put them all in a family and Then set The event create objet and select Thefamily as The object it will Take a random object from The family and créate it.


Yeah, that's how you can spawn random object. For random position, I think the easiest way is to spawn it using random X and Y like X(random(0, 300), random(0, 400)), etc.

Another way is that you can create some random spawn positions on the screen and numbered it. After that, create new object in random positions that you already set.
B
10
S
4
G
2
Posts: 36
Reputation: 2,207

Post » Sat Jun 07, 2014 12:01 am

ImageImage
B
102
S
46
G
22
Posts: 773
Reputation: 21,607


Return to How do I....?

Who is online

Users browsing this forum: jasontoups and 1 guest