jeudi 30 juillet 2015

How to prevent bounce in cocos2dx v3.7?

Game scence:

....
   auto edgeBody = PhysicsBody::createEdgeBox(winSize,PHYSICSBODY_MATERIAL_DEFAULT,3);
    auto edgeNode = Node::create();
    edgeNode->setPosition(winSize.width/2+origin.x , winSize.height/2+origin.y+10);
    edgeNode->setPhysicsBody(edgeBody);
....

Ball:

auto dinosaurBody = PhysicsBody::createCircle(dinosaurSprite->getContentSize().width/2);
dinosaurSprite->setPhysicsBody(dinosaurBody);

When ball collide with edge body it has bounce , how i remove it?

Aucun commentaire:

Enregistrer un commentaire