Ejemplo n.º 1
0
void Pointer::update()
{
	if (phase == PHASE_POINTING)
	{
		target = patterns[pattern_id]->pos[posIndex] * Gridscale;
		phaseCount++;
		if (phaseCount >= interval_point)
		{
			goNextPoint();
			phaseCount = 0;
		}
		if (posIndex >= patterns[pattern_id]->pos.size())
		{
			laserState = false;
			phase = PHASE_IDLE;
			phaseCount = 0;
		}
	}
	if (phase == PHASE_IDLE)
	{
//		target.set(0, 0);
		
		phaseCount++;
		if (phaseCount >= interval_pattern)
		{
			phase = PHASE_POINTING;
			phaseCount = 0;
			goNextPattern();
		}

	}
}
Ejemplo n.º 2
0
void EnemyBase::runRoute()
{
	goNextPoint();
	if (!m_isArriveEnd)
	{
		this->runAction(Sequence::create(MoveTo::create(getStepTime(), m_nextPoint), CallFuncN::create(CC_CALLBACK_0(EnemyBase::runRoute, this)), NULL));
	}
	else
	{
		EnemyManager::getInstance()->removeEnemy(this);
		this->removeFromParent();
	}
}