Multiple spawn offsets?

Get help using Construct 2

Post » Fri Apr 12, 2013 9:46 pm

I'm working on a top down game, i have items to be picked up that are spawned randomly around the layout. The problem i keep running into is that they sometimes spawn "on top of" each other. This causes problems:

1: looks tacky(bad)
2: bigger objects cover up smaller ones.

Is there a way to spawn multiple objects "at random" while avoiding Overlap?

Thanks in advance.
B
12
S
2
Posts: 75
Reputation: 2,126

Post » Fri Apr 12, 2013 10:12 pm

Run another event that checks if the objects are overlapping. If they are, pick one instance and destroy it, then recreate it elsewhere.

The only issue you'd face with this is that if the player ever sees the items spawn, then they have a chance of seeing the overlapping items for a single tick. To circumvent that issue you could give your items a fade in, active from the start, that is almost instant. That way they'll be invisible when they spawn for just a few ticks.

Example capx.GeometriX2013-04-12 22:16:12
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Sat Apr 13, 2013 1:05 am

Hey, thanks for the reply.

I tried to open your link, but C2 is telling me that it was made with version 125, and mine is 119.

I'm looking on the site, but i'm not finding 125...?

Thanks for the logic though, I'll try it out.
B
12
S
2
Posts: 75
Reputation: 2,126

Post » Sat Apr 13, 2013 1:06 am

Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Sat Apr 13, 2013 1:09 am

lol yeah, i just found it as you posted. Thanks though!
B
12
S
2
Posts: 75
Reputation: 2,126


Return to How do I....?

Who is online

Users browsing this forum: Braus and 15 guests