How do I place sprites randomly and move if overlapping

Get help using Construct 2

Post » Sun Feb 26, 2017 7:18 pm

I have a function which places a sprite, then it checks if its overlapping, and ifso, calls it again. This recursion should keep moving it until it is not overlapping. But unfortuatnely, it does not work.

Image


I just tried something wierd and it worked, but dont know why.

Image

Above I have moved the overlap detection code out of the function. So in theory, this code should never be called, or at least called only when the event sheet which contains it is included into the main event sheet?

Any ideas?
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Tue Feb 28, 2017 12:01 am

You might need to check overlapping on a sprite-basis, rather than family basis? I don't think overlap works for families.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: vino7733 and 28 guests