samedi 30 janvier 2016

cocos2dx detect intersection with polygon sprite

I am using cocos2d-x 3.8. I try to create two polygon sprites with the following code. I know we can detect intersect with BoundingBox but is too rough. is there a way to detect the intersect of polygon sprites? Thank you.

auto pinfoTree = AutoPolygon::generatePolygon("Tree.png");
auto treeSprite= Sprite::create(pinfoTree);
treeSprite-> setPosition(width / 4 * 3 - 30 , height / 2 - 200);
this->addChild(treeSprite);

auto pinfoBird = AutoPolygon::generatePolygon("Bird.png");
auto Bird= Sprite::create(pinfoTree);
Bird->setPosition(width / 4 * 3, height / 2);
this->addChild(Bird)

Aucun commentaire:

Enregistrer un commentaire