Game Development Reference
In-Depth Information
class ExplosionProcess : public Process
{
public:
ExplosionProcess() : Process(PROC_GAMESPECIFIC) { m_Stage=0; }
protected:
int m_Stage;
shared_ptr<SoundProcess> m_Sound;
virtual void VOnUpdate(unsigned long deltaMs);
virtual void VOnInit();
};
void ExplosionProcess::VOnInit()
{
Process::VOnInit();
Resource resource(
);
shared_ptr<ResHandle> srh = g_pApp->m_ResCache->GetHandle(&resource);
m_Sound.reset(GCC_NEW SoundProcess(srh));
// Imagine cool explosion graphics setup code here!!!!
//
//
//
explosion.wav
}
void ExplosionProcess::VOnUpdate(unsigned long deltaMs)
{
float progress = m_Sound->GetProgress();
switch (m_Stage)
{
case 0:
if (progress>0.55f)
{
++m_Stage;
// Imagine secondary explosion effect launch right here!
}
break;
case 1:
if (progress>0.75f)
{
++m_Stage;
// Imagine tertiary explosion effect launch right here!
}
break;
Search WWH ::




Custom Search