collisions with multiple objects

Hi,

I am new to Corona SDK and I am having trouble finding references to handling collisions between more than two objects.

I have a code that generates random objects and I want to be able to make ojects disapear if any 3 of the same type are touching. So I need to be able to tell the object type of all objects touching all other objects. [import]uid: 31694 topic_id: 6088 reply_id: 306088[/import]

Here are the two threads that helped me the most. The first one helps you understand collision filters and how to set them up (collision filters make it easier to define how objects interact with each other).

http://developer.anscamobile.com/forum/2010/10/25/collision-filters-helper-chart

And this next thread has a good example from jmp909 on how to remove objects when they collide.

http://developer.anscamobile.com/forum/2010/11/23/collision-detection-please-help [import]uid: 25480 topic_id: 6088 reply_id: 20943[/import]

Thanks for that it did help however I’m still stuck. In the below image I have three red blocks and two green blocks. I would like the red blocks to test that there is 3 of the same colour colliding and then remove all three blocks. I would like the green blocks to remain as they are because there are only two colliding not three.

However if the next block to fall happens to be green and it should collide with the current two green bricks I would like it to destroy all three blocks.
[import]uid: 31694 topic_id: 6088 reply_id: 21051[/import]

So your looking for “Match 3” logic? [import]uid: 6981 topic_id: 6088 reply_id: 21236[/import]

Yes [import]uid: 31694 topic_id: 6088 reply_id: 21295[/import]

you should read through this…
http://www.kongregate.com/forums/4-programming/topics/81112-match-3-type-game-with-box2d-trouble-with-the-match-3

it worked for me [import]uid: 6645 topic_id: 6088 reply_id: 30093[/import]