Thanks for the reply Andrew…
I have a ball on the screen and when it collides with anything, it should “win”. I wanted the collision function of the ball to handle everything it collides with it. I do use event.other to determine what the ball collided with.
All other physics objects have their own collision events that are fired when objects touch them (but not the ball). I use event.other here to determine what the object collided with.
What is strange is when 1 object type collides with the ball, the ball’s onCollision function is called. When another object type collides with the ball, the object’s onCollision is called (not the ball’s function). I can’t seem to figure out why, since I create the ball object first, and then create other object’s in a single function as they are needed.
I guess what I am looking to do is to have the ball’s onCollision function handle any collision between the ball and anything else. Also, if 2 physics object collide, how do I determine which object’s collision function is called?
I am using separate collision functions for each object type… would it be easier to have 1 onCollision function that handles every combination of object collision? Is there a preferred way to code all of these collisions?
Thanks again!
–john [import]uid: 114363 topic_id: 29054 reply_id: 116946[/import]