Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17124

How to know what two kinds of object is colliding?

$
0
0

@coco_pen wrote:

In my game there are a lot of kinds of physics objects.Now I add tag for every object class.So in onContactBegin,I need write a very long list to judge what kind of object is contact.getShapeA and contact.getShapeB.
Is there a easy way to do this?

For example in cocos2d-ipone
-(BOOL)ccPhysicsCollisionBegin:(CCPhysicsCollisionPair *)pair ClassA:(CCNode *)nodeA ClassB:(CCNode *)nodeB
So it's already know nodeA is ClassA and nodeB is ClassB

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17124

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>