主要代码如下:
bool HelloWorld::init()
{
…
CCSprite* pSpriteUnder = CCSprite::create(“pep.png”);
spr->setPosition(ccp(48,48));
move_right = CCMoveTo::create(0.5,ccp(32,0));//move_right为成员变量
spr->runAction(move_right);
setTouchEnabled(true);
…
}
bool HelloWorld::ccTouchBegan(CCTouch* touch, CCEvent* event)
{
…
spr->runAction(move_right);
…
}
这个程序里面init里面的runAction可以正常执行,而ccTouchBegan在程序执行时会发生中断。
中断在库文件CCActionManager.cpp里面的这一行:pAction->startWithTarget(pTarget);
请问大家这是什么原因?