精灵点击移动

CCSetIterator it = pTouches->begin();



    CCTouch *touch = (CCTouch*)(*it);



    CCPoint m_tBeginPos = touch->getLocationInView();



    m_tBeginPos = CCDirector::sharedDirector()->convertToGL(m_tBeginPos);



    CCAction *moveto = CCMoveTo::create(2, m_tBeginPos);



    player->runAction(moveto);

 

你可能感兴趣的:(移动)