Example #1
0
void Sfx::AddThrustSmoke(const Body *b, TYPE t, const float speed, vector3d adjustpos)
{
	Sfx *sfx = AllocSfxInFrame(b->GetFrame());
	if (!sfx) return;

	sfx->m_type = t;
	sfx->m_age = 0;
	sfx->m_speed = speed;
	vector3d npos = b->GetPosition();
	sfx->SetPosition(npos+adjustpos);
	sfx->m_vel = vector3d(0,0,0);
}
Example #2
0
void Sfx::Add(const Body *b, TYPE t)
{
	Sfx *sfx = AllocSfxInFrame(b->GetFrame());
	if (!sfx) return;

	sfx->m_type = t;
	sfx->m_age = 0;
	sfx->SetPosition(b->GetPosition());
	sfx->m_vel = b->GetVelocity() + 200.0*vector3d(
			Pi::rng.Double()-0.5,
			Pi::rng.Double()-0.5,
			Pi::rng.Double()-0.5);
}
Example #3
0
void volume( int oldValue )
{
	if (sfx) sfx.volumeChange();
}
Example #4
0
	void stop(void* id)
	{
		sfx.stop(id);
	}
Example #5
0
	bool isPlaying(void* id)
	{
		return sfx.isPlaying(id);
	}
Example #6
-1
	void play(int sound, void* id = 0, int loops = 0)
	{
		sfx.play(common, sound, id, loops);
	}