Esempio n. 1
0
	CCTwirl* CCTwirl::actionWithPosition(CCPoint pos, int t, float amp, const ccGridSize& gridSize, ccTime duration)
	{
		CCTwirl *pAction = new CCTwirl();

		if (pAction)
		{
			if (pAction->initWithPosition(pos, t, amp, gridSize, duration))
			{
				pAction->autorelease();
			}
			else
			{
				CC_SAFE_RELEASE_NULL(pAction);
			}
		}

		return pAction;
	}
Esempio 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->initWithPosition(m_position, m_nTwirls, m_fAmplitude, m_sGridSize, m_fDuration);

		CC_SAFE_DELETE(pNewZone);
		return pCopy;
	}