I've been trying to figure this out for a while now...
I have a layout full of instances of the same sprite.
I'd like to go through each instance and check if it overlaps with another instance of itself.
Then do a set of actions with pick instance 0 / instance 1.
My problem is:
How do I combine these two? Or am i going about this the wrong way?
Create a family with this sprite and use it to refer to another instance of the sprite in the same event.
For each Sprite
...Sprite overlapping SpriteFamily
........SpriteFamily Set Invisible
........Sprite Set Visible
dop2000 holy **** it works!
Also do you think there is any way to solve this without using families?
I'm just asking because the solution seems like a workaround to the problem and if there is any other way it could work I'd like to know; to better understand this stuff.
Yes, it's a workaround, but it's a legit workaround
I think I saw it in one of the official tutorials.
I guess you can do the same with a function. If sprites are overlapping, call a function, pass sprite UID as a parameter. Inside the function pick all sprites with UID<>param(0), check overlapping again and... not sure what's next. I remember doing something like this, but I don't remember how
The method with the family is much easier.
Develop games in your browser. Powerful, performant & highly capable.
I image you'd have the same problem with functions as the first problem I had. You can't get the id of the 2nd instance if you stop using families (when checking all instances).
Anyways thanks for the help!
Also, your game looks really nice!