当前位置: 首页>>代码示例>>C++>>正文


C++ CAudioManager::CreateSound方法代码示例

本文整理汇总了C++中CAudioManager::CreateSound方法的典型用法代码示例。如果您正苦于以下问题:C++ CAudioManager::CreateSound方法的具体用法?C++ CAudioManager::CreateSound怎么用?C++ CAudioManager::CreateSound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAudioManager的用法示例。


在下文中一共展示了CAudioManager::CreateSound方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetUp

void CPlasmaShot::SetUp(int shotowner, CGameObject * projectileowner, float damage, float damageradius, float velocity)
{
   // Save the type of object that shot this weapon
   SetOwner(shotowner);
   
   // Damage of the projectile
   SetDamage((int)damage);

   m_ProjectileOwner = projectileowner;

   if(shotowner == PLAYER_SHOT || FRIENDLY_SHOT)
   {
      m_PlasmaExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 9);
      m_PlasmaInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_PLASMAINAIR], 1);
   }
   else if(shotowner == ENEMY_SHOT)
   {
      m_PlasmaExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 7);
      m_PlasmaInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_PLASMAINAIR], 6);    
   }

   m_PlasmaInAir->Play3DAudio(10.0f, 10000.0f, 100);

   m_Active = true;
   m_Velocity = velocity;
   m_DamageRadius = damageradius;

   m_CreationTime = g_time;
   m_LifeTime = 3.0f;

   // Get the position of the object
   GetPosition(&m_CurPosition, 0);
   m_LastPosition = m_CurPosition; 
}
开发者ID:eclifford,项目名称:prototype-game,代码行数:34,代码来源:plasmashot.cpp

示例2: SetUp

void CTrackingMissile::SetUp(int shotOwner, int damage, bool left, float damageradius, float accuracy, CGameObject * projectileowner)
{
   // Save the type of object that shot this weapon
   SetOwner(shotOwner);

	m_Tracking = false;
	m_UpdatePeriod = accuracy;
	m_SlerpScale = 1.0f / m_UpdatePeriod;
   m_DamageRadius = damageradius;
   
   // Damage of the projectile
   SetDamage(damage);
   m_Velocity = 40.0f;

   // Pointer to the game object that owns this shot
   m_ProjectileOwner = projectileowner;

   if(shotOwner == PLAYER_SHOT)
   {
      m_MissileExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 9);
      m_MissileInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_MISSILEINAIR], 7);
   }
   else if(shotOwner == ENEMY_SHOT)
   {
      m_MissileExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_EXP_TINY], 7);
      m_MissileInAir = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_MISSILEINAIR], 6);
   }

   m_MissileInAir->Play3DAudio(10.0f, 10000.0f, 75);
   
   m_Active = true;

   m_CreationTime = g_time;
   m_LifeTime = 10.0f;

	CObjFrame temp = *m_RenderObj.GetFrame(0);
	temp.GetOrientation(&m_Q0);
	m_Q2 = m_Q0;
	temp.RotateLocalX(-PI / 6.0f);
	temp.GetOrientation(&m_Q1);

   // Get the position of the object
   GetPosition(&m_CurPosition, 0);
   m_LastPosition = m_CurPosition; 
}
开发者ID:eclifford,项目名称:prototype-game,代码行数:45,代码来源:trackingmissile.cpp

示例3: SetUp

void CIonFlare::SetUp(int shotowner, CGameObject * projectileowner, float damage, float damageradius, float velocity)
{
   // Save the type of object that shot this weapon
   SetOwner(shotowner);
   
   // Damage of the projectile
   SetDamage((int)damage);

   m_PlasmaExplode = g_AudioManager.CreateSound(g_AudioManager.samples[SFX_PLAYER_IONCANNON], 10);

   m_Active = true;
   m_Velocity = velocity;
   m_DamageRadius = damageradius;

   m_CreationTime = g_time;
   m_LifeTime = 3.0f;
}
开发者ID:eclifford,项目名称:prototype-game,代码行数:17,代码来源:ionflare.cpp


注:本文中的CAudioManager::CreateSound方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。