How do I do Advanced Spawning and Randomization?

Get help using Construct 2

Post » Mon May 25, 2015 10:53 pm

Hey guys! I'll try to explain this as best I can. I'm trying to spawn (x) amount of objects in a certain space, but I need specific objects to spawn, and the rest of the space to be filled with multiple instances of another object.

I already have the space defined with an array, but now I need to manipulate how objects spawn within that array. Let's say I have a space like this :

Image

As you can see I have a 3x3 space of the same object, but let's say I want to inject two different objects into the 3x3 space, spawning in random available spaces in that 3x3 space and filling the remaining slots with our blue circle control group every time the layout is run, like this :

Image

or this :

Image

The problem isn't spawning the unique objects in random positions in the 3x3 space and filling the rest of the 3x3 space with one object with multiple instances. The problem is that when the unique objects spawn in the 3x3 space, there's a chance that they will overlap one another. Let's say I want to spawn 2 unique objects among the controlled object with multiple instances in the 3x3 space. I need a way to ensure that they won't spawn on the same tile If one unique objects spawns on one space, I need to make sure that the other object knows that space is no longer available to spawn on.
B
9
S
2
Posts: 34
Reputation: 679

Post » Tue May 26, 2015 12:37 am

B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Tue May 26, 2015 1:01 am

korbaach wrote:just a thought...

capx> http://s000.tinyupload.com/index.php?fi ... 5803457407
(r200)


I love you. :D
B
9
S
2
Posts: 34
Reputation: 679

Post » Tue May 26, 2015 1:03 am

:D
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests