如何防止在cocos2dx v3.7中反弹?

时间:2015-07-30 16:44:03

标签: c++ c++11 cocos2d-x-3.0

游戏场景:

....
   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);
....

球:

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

当球与边缘身体发生碰撞时,它会弹起,我该如何移除它?

1 个答案:

答案 0 :(得分:1)

尝试

slideshow

还要看一下:http://cocos2d-x.org/programmersguide/12/