//
// ReverseTime
//
CCReverseTime* CCReverseTime::actionWithAction(CCFiniteTimeAction *pAction)
{
	// casting to prevent warnings
	CCReverseTime *pReverseTime = new CCReverseTime();
	pReverseTime->initWithAction(pAction);
	pReverseTime->autorelease();

	return pReverseTime;
}
Ejemplo n.º 2
0
CommandHit* CommandHit::create(ID iid)
{
	CommandHit* hit = new CommandHit();
	Actor* actor = Engine::world->getActor(iid);
	hit->mActorSprite = actor->sprite();
	CCTintTo* tintTo = CCTintTo::create(0.1f, 50, 0, 0);
	tintTo->retain();
	CCReverseTime *tintBack = CCReverseTime::create(tintTo);
	tintBack->retain();
	hit->mTint = CCSequence::createWithTwoActions(tintTo, tintBack);
	hit->mTint->retain();
	hit->mHitEmitter = CCParticleSystemQuad::create("Data/hit.xml");
	hit->mHitEmitter->retain();
	return hit;
}
CCObject* CCReverseTime::copyWithZone(CCZone *pZone)
{
	CCZone* pNewZone = NULL;
	CCReverseTime* pCopy = NULL;
	if(pZone && pZone->m_pCopyObject) 
	{
		//in case of being called at sub class
		pCopy = (CCReverseTime*)(pZone->m_pCopyObject);
	}
	else
	{
		pCopy = new CCReverseTime();
		pZone = pNewZone = new CCZone(pCopy);
	}

	CCActionInterval::copyWithZone(pZone);

	pCopy->initWithAction((CCFiniteTimeAction*)(m_pOther->copy()->autorelease()));

	CC_SAFE_DELETE(pNewZone);
	return pCopy;
}