Hi guys,
I start using physics ( mostly for collision detection and to move bunch of objects toward couple targets using impulses) The target are fix in position ( but they can rotate)
Anyway my question is: do I need to set a local collision event listerner for both the moving objects and the fixed targets? Right now Iam spawning bunch of objects (dynamic) that need to collide with the targets. I only have a collision listerner attached to each of those objects but none to the targets. It seems to work ok ( to a point since if the spawn rate is little higher the objects go through the targets...another issue I think)
Is this is the correct way to proceed or do I need to attach an event listener to the targets as well? In that case what do I need to put in that event listerner function? I am already dealing with the collision to the target on the moving objects event listerner function. It seems redandant to have both moving objects and the targets to have each a collision event listerner? Maybe I am wrong and that is why sometimes objects are going through the static targets
As you can see I fully confused!
Thanks for any pointers.
Mo
Ps: if I need only need to attach event listerners to one body, maybe I should attach it to the non moving targets since they are a fix ( and low number of them during the game play) unlike the moving objects ( you can view them as some sort of bullets) are spawned all during the game. And remove at impact with the fix targets....just curious what you think. Maybe attaching event listerners to the targets ( max of 3) would be less costly in term of physics since the engine will only need to do collision detection on maximum 3 objects.... Thanks.