Creating Objects far apart from eachother?

Get help using Construct 2

Post » Sat Aug 10, 2013 11:28 pm

You have Sprite1.

How would you spawn 10 instaces of Sprite 1 at random coordinates, with at least 100px distance between all of them?

Been trying to figure it out all night but no results so far.Xionor2013-08-10 23:32:24
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Sun Aug 11, 2013 12:05 am

Not sure if this is the best way, but it works.

I created a spawn sprite called Spawn and a check sprite called Check.

The check sprite is 100,100 to give your distance. Naturally you would hide the check sprite, and in game I would even delete them all after you are done.

You can probably also do this without the check sprite, but using Is Overlapping at offset.

https://www.dropbox.com/s/ze9nzlctjprdt78/distance.capx

ArcadEd2013-08-11 00:10:52
B
100
S
31
G
11
Posts: 1,552
Reputation: 21,522

Post » Sun Aug 11, 2013 12:23 am

Pretty nice idea.

Tho with a bigger Check it can take up to 10-15 seconds to place 10 objects apart with the method you're suggesting. And I need it to happen instantly on Layout Start.

Also if the number of objects makes it impossible to place them all in a way that they don't overlap - it just keeps looping forever.Xionor2013-08-11 00:28:03
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Sun Aug 11, 2013 10:53 am

The only instant solution i've found so far is making pre-placed "spawn boxes" within which the objects are allowed to spawn.
B
10
S
3
Posts: 233
Reputation: 1,537


Return to How do I....?

Who is online

Users browsing this forum: Ajbael, plinkie, Yahoo [Bot] and 10 guests