Hi,
I have a Sprite called "Ball" and each has an instance variable "Health" (number). When two Balls collide, I want the one with the lower health to be destroyed. However, I'm not sure how to differentiate between the two instances involved in the collision. Here's the best I could come up with:
<img src="https://dl.dropbox.com/u/32626868/Pictures/Collision.png" border="0" />
Here's my understanding of what's going on:
1. When a Ball collides with another Ball, the event is triggered and the two Ball instances are picked for the event.
2. Each Ball's Health variable is compared. I want it to compare it's Health variable to that of the other Ball, but I'm not sure how to specify this.
3. If the Ball's health was lower, it is destroyed; otherwise, nothing happens (once again, I'm not sure how to tell it which of the two Ball's should be destroyed).
I have verified that the collision event is registering, but neither ball is being destroyed when it happens even though one's health is lower than the other. How can I reference specific instances involved in the collision to get this to work? I thought of using "Pick Nth instance," but if I understand correctly that means the Nth out of all instances, not just those in the collision, correct?
Thanks!