예제 #1
0
void CGameScene::PushEffect(float x, float y) {
	CParticleSystem *p = new CParticleSystem("resource/particle/particle.png", 50);
	p->SetPosition(x, y);
	p->setScalep(1, 1);
	p->setColor1(400, 200, 220, 200);
	p->setLife(0.2, 0.3);
	m_pEffectScene->PushScene(p);
	p->start();
}
예제 #2
0
void CEnemy1::Update(float eTime)
{
	IEnemy::Update(eTime);
	CGameScene *gs = (CGameScene*)this->parent->parent;
	
	if (hp <= 0)
	{
		CParticleSystem *p = gs->PushEffect(pos.x + ani->width/2, pos.y + ani->height/2 + 55.0f);
		p->setScalep(4.0f, 5.0f);
		p->direction = -90;
		p->spread = 30;
		p->setSpeed(400.0f, 700.0f);
		p->start();


		CGSoundManager * sm = App::GetInstance()->g_pSoundManager;
		sm->Play(2);
		
		this->parent->PopScene(this);
		return;
	}

	time += eTime;
	time2 += eTime;
	if (pos.y < 50)
	{
		pos.y += 150 * eTime;
		if (pos.y > 50) pos.y = 50;
	}

	if (time > 3.0f)
	{
		gs->PushEffect(this->pos.x+20, this->pos.y + 140);
		gs->PushArrow(this->pos.x - 65, this->pos.y + 170, D3DX_PI / 2);
		gs->PushArrow(this->pos.x - 65, this->pos.y + 170, D3DX_PI / 2 - 0.4);
		gs->PushArrow(this->pos.x - 65, this->pos.y + 170, D3DX_PI / 2 + 0.4);
		time = 0.f;
	}

	if (time2 > 7.0f)
	{
		pos.y += 700 * eTime;
	}

	if (pos.y > App::HEIGHT)
	{
		this->parent->PopScene(this);
		return;
	}

}