本文整理汇总了C++中sgd::AudioManager::LoadAudio方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioManager::LoadAudio方法的具体用法?C++ AudioManager::LoadAudio怎么用?C++ AudioManager::LoadAudio使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sgd::AudioManager
的用法示例。
在下文中一共展示了AudioManager::LoadAudio方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// Enter
/*virtual*/ void IntroState::Enter(void)
{
// Set background color
SGD::GraphicsManager::GetInstance()->SetClearColor({ 0, 0, 0 }); // black
//starting_y = Game::GetInstance()->GetScreenHeight() + 20.0F;// * 15.0F;// + 170.0F;
// Load assets
SGD::GraphicsManager* pGraphics = SGD::GraphicsManager::GetInstance();
SGD::AudioManager* pAudio = SGD::AudioManager::GetInstance();
AnimationManager* pAnimationManager = AnimationManager::GetInstance();
//pAnimationManager->Load("resource/config/animations/Zombie_Animation_New.xml", "zombie");
//animation.m_strCurrAnimation = "zombie";
m_hBackgroundImage = pGraphics->LoadTexture("resource/graphics/MenuImages/emergencybroadcast.png");
m_hEmergency = pAudio->LoadAudio("resource/audio/zombieemergency.wav");
IntroTimer.AddTime(60);
ScreenTimer.AddTime(.1f);
pAudio->PlayAudio(m_hEmergency, false);
//m_hBackgroundImage = pGraphics->LoadTexture("resource/graphics/youLose.png");
//m_hBackgroundMusic = pAudio->LoadAudio("resource/audio/JNB_Credits_PinballGroove.xwm");
//pAudio->PlayAudio(m_hBackgroundMusic);
}
示例2: if
// Enter
/*virtual*/ void IntroState::Enter(void)
{
// Set background color
SGD::GraphicsManager::GetInstance()->SetClearColor({ 0, 0, 0 }); // black
//starting_y = Game::GetInstance()->GetScreenHeight() + 20.0F;// * 15.0F;// + 170.0F;
// Load assets
SGD::GraphicsManager* pGraphics = SGD::GraphicsManager::GetInstance();
SGD::AudioManager* pAudio = SGD::AudioManager::GetInstance();
AnimationManager* pAnimationManager = AnimationManager::GetInstance();
//pAnimationManager->Load("resource/config/animations/Zombie_Animation_New.xml", "zombie");
//animation.m_strCurrAnimation = "zombie";
pAudio->SetVoiceVolume(Game::GetInstance()->m_hMainVoice, 35);
m_hBackgroundImage = pGraphics->LoadTexture("resource/graphics/MenuImages/emergencybroadcast.png");
m_hinstruct = SGD::GraphicsManager::GetInstance()->LoadTexture("resource/graphics/MenuImages/ArcadeControlsIcons.png");
m_hEmergency = pAudio->LoadAudio("resource/audio/zombieemergency.wav");
if (IntroTimer.GetTime() < 45.0f)
{
float newTime = 45.0f - IntroTimer.GetTime();
IntroTimer.AddTime(newTime);
}
else if (IntroTimer.GetTime() <= 0.0f)
IntroTimer.AddTime(45.0f);
if (ScreenTimer.GetTime() < .1f)
{
float newTime = .1f - ScreenTimer.GetTime();
ScreenTimer.AddTime(newTime);
}
else if (ScreenTimer.GetTime() <= 0.0f)
ScreenTimer.AddTime(.1f);
transBack = 255;
transTextFirst = 0;
transText = 0;
//IntroTimer.AddTime(45.0f - IntroTimer.GetTime());
//ScreenTimer.AddTime(.1f - ScreenTimer.GetTime());
pAudio->PlayAudio(m_hEmergency, false);
//m_hBackgroundImage = pGraphics->LoadTexture("resource/graphics/youLose.png");
//m_hBackgroundMusic = pAudio->LoadAudio("resource/audio/JNB_Credits_PinballGroove.xwm");
//pAudio->PlayAudio(m_hBackgroundMusic);
}
示例3: Load
//.........这里部分代码省略.........
// Damage Upgrade Values
TiXmlElement* hockeyStickDamage = hockeyStick->FirstChildElement("damage_upgrade");
// Tier 1
TiXmlElement* hockeyStickDamageOne = hockeyStickDamage->FirstChildElement("tier_one");
hockeyStickDamageOne->FirstChildElement("cost")->Attribute("value", &m_nHockeyStickDamageUpgradeCost[0]);
hockeyStickDamageOne->FirstChildElement("damage")->Attribute("value", &temp);
m_fHockeyStickDamage[1] = (float)temp;
// Tier 2
TiXmlElement* hockeyStickDamageTwo = hockeyStickDamage->FirstChildElement("tier_two");
hockeyStickDamageTwo->FirstChildElement("cost")->Attribute("value", &m_nHockeyStickDamageUpgradeCost[1]);
hockeyStickDamageTwo->FirstChildElement("damage")->Attribute("value", &temp);
m_fHockeyStickDamage[2] = (float)temp;
// Tier 3
TiXmlElement* hockeyStickDamageThree = hockeyStickDamage->FirstChildElement("tier_three");
hockeyStickDamageThree->FirstChildElement("cost")->Attribute("value", &m_nHockeyStickDamageUpgradeCost[2]);
hockeyStickDamageThree->FirstChildElement("damage")->Attribute("value", &temp);
m_fHockeyStickDamage[3] = (float)temp;
// Spin Rate Upgrade Values
TiXmlElement* hockeyStickSpinRate = hockeyStick->FirstChildElement("spin_rate_upgrade");
// Tier 1
TiXmlElement* hockeyStickSpinRateOne = hockeyStickSpinRate->FirstChildElement("tier_one");
hockeyStickSpinRateOne->FirstChildElement("cost")->Attribute("value", &m_nHockeyStickSpinRateUpgradeCost[0]);
hockeyStickSpinRateOne->FirstChildElement("spin_rate")->Attribute("value", &temp);
m_fHockeyStickSpinRate[1] = (float)temp;
// Tier 2
TiXmlElement* hockeyStickSpinRateTwo = hockeyStickSpinRate->FirstChildElement("tier_two");
hockeyStickSpinRateTwo->FirstChildElement("cost")->Attribute("value", &m_nHockeyStickSpinRateUpgradeCost[1]);
hockeyStickSpinRateTwo->FirstChildElement("spin_rate")->Attribute("value", &temp);
m_fHockeyStickSpinRate[2] = (float)temp;
// Tier 3
TiXmlElement* hockeyStickSpinRateThree = hockeyStickSpinRate->FirstChildElement("tier_three");
hockeyStickSpinRateThree->FirstChildElement("cost")->Attribute("value", &m_nHockeyStickSpinRateUpgradeCost[2]);
hockeyStickSpinRateThree->FirstChildElement("spin_rate")->Attribute("value", &temp);
m_fHockeyStickSpinRate[3] = (float)temp;
#pragma endregion
#pragma region Laser Tower
// Laser Tower
TiXmlElement* laser = pRoot->FirstChildElement("laser");
// Starting Values
laser->FirstChildElement("damage")->Attribute("value", &m_nLaserDamage[0]);
laser->FirstChildElement("range")->Attribute("value", &m_nLaserRange[0]);
// Damage Upgrade Values
TiXmlElement* laserDamage = laser->FirstChildElement("damage_upgrade");
// Tier 1
TiXmlElement* laserDamageOne = laserDamage->FirstChildElement("tier_one");
laserDamageOne->FirstChildElement("cost")->Attribute("value", &m_nLaserDamageUpgradeCost[0]);
laserDamageOne->FirstChildElement("damage")->Attribute("value", &m_nLaserDamage[1]);
// Tier 2
TiXmlElement* laserDamageTwo = laserDamage->FirstChildElement("tier_two");
laserDamageTwo->FirstChildElement("cost")->Attribute("value", &m_nLaserDamageUpgradeCost[1]);
laserDamageTwo->FirstChildElement("damage")->Attribute("value", &m_nLaserDamage[2]);
// Tier 3
TiXmlElement* laserDamageThree = laserDamage->FirstChildElement("tier_three");
laserDamageThree->FirstChildElement("cost")->Attribute("value", &m_nLaserDamageUpgradeCost[2]);
laserDamageThree->FirstChildElement("damage")->Attribute("value", &m_nLaserDamage[3]);
// Range Upgrade Values
TiXmlElement* laserRange = laser->FirstChildElement("range_upgrade");
// Tier 1
TiXmlElement* laserRangeOne = laserRange->FirstChildElement("tier_one");
laserRangeOne->FirstChildElement("cost")->Attribute("value", &m_nLaserRangeUpgradeCost[0]);
laserRangeOne->FirstChildElement("range")->Attribute("value", &m_nLaserRange[1]);
// Tier 2
TiXmlElement* laserRangeTwo = laserRange->FirstChildElement("tier_two");
laserRangeTwo->FirstChildElement("cost")->Attribute("value", &m_nLaserRangeUpgradeCost[1]);
laserRangeTwo->FirstChildElement("range")->Attribute("value", &m_nLaserRange[2]);
// Tier 3
TiXmlElement* laserRangeThree = laserRange->FirstChildElement("tier_three");
laserRangeThree->FirstChildElement("cost")->Attribute("value", &m_nLaserRangeUpgradeCost[2]);
laserRangeThree->FirstChildElement("range")->Attribute("value", &m_nLaserRange[3]);
#pragma endregion
// Load Sounds
SGD::AudioManager* pAudio = SGD::AudioManager::GetInstance();
m_hSellSound = pAudio->LoadAudio("resource/audio/doorClose.wav");
m_hInvalidSound = pAudio->LoadAudio("resource/audio/invalidPurchase.wav");
m_hMachineGunShotSound = pAudio->LoadAudio("resource/audio/machineGunShot.wav");
m_hMapleSyrupShotSound = pAudio->LoadAudio("resource/audio/mapleSyrupShot.wav");
m_hHockeyStickSlashSound = pAudio->LoadAudio("resource/audio/hockeyStickSlash.wav");
}