How can I identify when the ground body collides with another b2Body? I can use
b2ContactListener to be notified of collision events, but how do I tell which bodies collided?
This is the point of b2Body's
For a trivial case, you can make the user data a NSString. For example,
Then inside your
(n.b. This is not compatible with ARC. I wouldn't recommend using ARC with games yet if you're an Objective-C beginner. The libraries aren't ready and the best idioms have not gelled).