cocos2D-X应用程序适用于Android但在iOS上崩溃

时间:2013-01-17 14:54:18

标签: android ios ios6 cocos2d-x

该功能未正确校准但是“工作”(至少在Android上)

void HelloWorld::continueshipMovement() {


    CCNode *node = this->getChildByTag(asterioTag);
    CCSprite *sprite = (CCSprite*)node;



    if (trafico.size() < 0 or sprite->getActionByTag(actionTag)) {
        return;
    }

    std::pair<float, float> valueOfPt = trafico.back();
    trafico.pop_back();
    CCPoint newPt = ccp(valueOfPt.first, valueOfPt.second);
    float distace = ccpDistance(sprite->getPosition(), newPt);
    float duration = distace / ShipSpeed;
    CCMoveTo *move = CCMoveTo::create(duration, newPt);
    CCSequence *moveseq = CCSequence::createWithTwoActions(move, CCCallFunc::create(this, callfunc_selector(HelloWorld::continueshipMovement)));
    moveseq->setTag(actionTag);
    sprite->runAction(moveseq);



}
当我触摸屏幕时IOS上的应用程序崩溃,从CCNode转换为CCSprite时似乎失败。

这是Xcode显示的错误:

1

2

0 个答案:

没有答案