i'm trying to achieve the following scenario: a number of circles are drifting towards the center of the screen. if any of the circles overlaps another circle, they get pushed away from one another (so that no two circles overlap). the effect should (in the end) be similar to this.
i am having a hard time getting construct to pick the right objects and generally do as it is told. i have almost gotten it to work, but the event sheet looks horribly wrong; some 'pick by evaluate' conditions appear to not evaluate unless preposed with a 'for each' loop & other such nuisance, and the entire thing runs at 7fps when started.
maybe somebody already did something like that (overlapping of same object type) and has the clever solution, or would like to point out the principal error in my approach?
The only propely working solution is to apply two families to same object type, and make conditions where "Family A" overlaps with "Family B" to distanguish the different instances. There have been discussion about this before, http://www.scirra.com/phpBB3/viewtopic.php?f=3&t=1541&st=0&sk=t&sd=a&start=20, http://www.scirra.com/phpBB3/viewtopic.php?f=16&t=1667 and http://www.scirra.com/phpBB3/viewtopic.php?f=17&t=1740&p=12449
I don't know how many objects you're planning on having, but keep in mind that checking for collisions against the same object is essentially the same as looping through every object every time it has to do a collision check, so with 100 objects, it'll actually be checking collisions 10,000 times. I just wanted to point that out since it could become a bottleneck for performance in your game.
Doesn't construct have to loop though objects anyway, even if the colliding objects weren't same type?
Well, it's internal loop so it's probably a lot faster...
Yeah it does, but performing a collision check is a pretty expensive operation, so it soon adds up in a large loop like that.
Develop games in your browser. Powerful, performant & highly capable.
thank you very much for these important hints!
seems i have a few pages of forum material to catch up with :)
p.s. you rock! :)