Exemplo n.º 1
0
CCTwirl* CCTwirl::create(float duration, const CCSize& gridSize, CCPoint position, unsigned int twirls, float amplitude)
{
    CCTwirl *pAction = new CCTwirl();

    if (pAction)
    {
        if (pAction->initWithDuration(duration, gridSize, position, twirls, amplitude))
        {
            pAction->autorelease();
        }
        else
        {
            CC_SAFE_RELEASE_NULL(pAction);
        }
    }

    return pAction;
}
Exemplo n.º 2
0
CCObject* CCTwirl::copyWithZone(CCZone *pZone)
{
    CCZone* pNewZone = NULL;
    CCTwirl* pCopy = NULL;
    if(pZone && pZone->m_pCopyObject)
    {
        //in case of being called at sub class
        pCopy = (CCTwirl*)(pZone->m_pCopyObject);
    }
    else
    {
        pCopy = new CCTwirl();
        pZone = pNewZone = new CCZone(pCopy);
    }

    CCGrid3DAction::copyWithZone(pZone);


    pCopy->initWithDuration(m_fDuration, m_sGridSize, m_position, m_nTwirls, m_fAmplitude);

    CC_SAFE_DELETE(pNewZone);
    return pCopy;
}