Cocos2dx利用intersectsRect函数检测碰撞
1 if (sp1->boundingBox().intersectsRect(sp2->boundingBox())) { 2 pLabel->setString(“碰撞飞机爆炸”); 3 }else 4 pLabel->setString(“~还没有碰撞·~”); 5 6 }
read the fucking source code
1 if (sp1->boundingBox().intersectsRect(sp2->boundingBox())) { 2 pLabel->setString(“碰撞飞机爆炸”); 3 }else 4 pLabel->setString(“~还没有碰撞·~”); 5 6 }