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


C++ COptions::GetMusicVolume方法代码示例

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


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

示例1: Enter

void CGamePlay::Enter()
{
	COptions *op = COptions::GetInstance();
	CSGD_ObjectFactory<string, CBase> *pOF		= CSGD_ObjectFactory<string, CBase>::GetInstance();
	CSGD_ObjectManager *pOM						= CSGD_ObjectManager::GetInstance();
	CSGD_TextureManager *pTM					= CSGD_TextureManager::GetInstance();
	CPlayerCharacter *pPC						= CPlayerCharacter::GetInstance();
	CSGD_EventSystem *pEM						= CSGD_EventSystem::GetInstance();
	CSGD_DirectSound *pDS						= CSGD_DirectSound::GetInstance();
	CSGD_WaveManager* pWM						= CSGD_WaveManager::GetInstance();


	m_nBridgeOffset = 0;
	m_nSpaceOffset = 0;
	m_nEnemyCounter = 0;
	m_nTotalSpawns = 0;

	stateTimer = 6.0f;
	m_fSpawnPowerupTimer = 15.0f;

	//	Register classes with ObjectFactory
	pEM->RegisterClient("scroll right", this);
	pEM->RegisterClient("scroll left", this);
	pEM->RegisterClient("spawn enemies",this);
	pEM->RegisterClient("spawn powerups",this);

	pOF->RegisterClassType<CPlayerCharacter>("CPlayerCharacter");
	pOF->RegisterClassType<CBullet>("CBullet");
	pOF->RegisterClassType<CEnemyDemon>("CEnemyDemon");
	pOF->RegisterClassType<CEnemyBusiness>("CEnemyBusiness");
	pOF->RegisterClassType<CBulletPaper>("CBulletPaper");
	pOF->RegisterClassType<CEnemyMeat>("CEnemyMeat");
	pOF->RegisterClassType<CBulletFire>("CBulletFire");
	pOF->RegisterClassType<CEnemyBooger>("CEnemyBooger");
	pOF->RegisterClassType<CPowerup1up>("CPowerup1up");
	pOF->RegisterClassType<CPowerupHealth>("CPowerupHealth");
	pOF->RegisterClassType<CPowerupRapidFire>("CPowerupRapidFire");
	pOF->RegisterClassType<CPowerupThreeWay>("CPowerupThreeWay");
	pOF->RegisterClassType<CEnemyPsycrow>("CEnemyPsycrow");
	pOF->RegisterClassType<CBulletHook>("CBulletHook");

	m_nImageID[0] = pTM->LoadTexture("Resource\\JoA_EarthwormJim.bmp", D3DCOLOR_XRGB(80,192,64));
	m_nImageID[1] = pTM->LoadTexture("Resource\\JoA_jim_level2enemies.png",D3DCOLOR_XRGB(0,64,128));
	m_nImageID[2] = pTM->LoadTexture("Resource\\JoA_ewj2-flaminyawn.png",D3DCOLOR_XRGB(0,64,128));
	m_nImageID[3] = pTM->LoadTexture("Resource\\JoA_earthwormjim-items.png",D3DCOLOR_XRGB(0,128,255));
	m_nImageID[4] = pTM->LoadTexture("Resource\\JoA_ewj_forpete.png",D3DCOLOR_XRGB(0,64,128));
	m_nBGID		  = pTM->LoadTexture("Resource\\JoA_jim_psycro.png", D3DCOLOR_XRGB(0,64,128));

	pOM->AddObject(CPlayerCharacter::GetInstance());

	m_fFinishedTimer = 5.0f;

	m_Font.SetFontImageID( CSGD_TextureManager::GetInstance()->LoadTexture("resource/JoA_023 - small.bmp", D3DCOLOR_XRGB(0, 0, 0)) );
	m_Font.SetCharWidth( 16 );
	m_Font.SetCharHeight( 16 );
	m_Font.SetNumCols( 10 );
	m_Font.SetStartChar( ' ' );

	m_Font2.SetFontImageID( CSGD_TextureManager::GetInstance()->LoadTexture("resource/JoA_023 - large.bmp", D3DCOLOR_XRGB(0, 0, 0)) );
	m_Font2.SetCharWidth( 32 );
	m_Font2.SetCharHeight( 32 );
	m_Font2.SetNumCols( 10 );
	m_Font2.SetStartChar( ' ' );

	pPC->SetBulletScale(1.0f);
	pPC->SetRateOfFire(7);
	pPC->SetHP(100);
	pPC->SetPosX( 100.0f );
	pPC->SetImageID(m_nImageID[0]);
	pPC->SetThreeWay(false);
	pPC->SetGodMode(false);
	pPC->SetVelX(0.00000004f);
	pPC->SetVelY(0.00000004f);
	pPC->SetInvulnerable(false);
	pPC->SetRapidFireTimer(0.0f);
	pPC->SetThreeWayTimer(0.0f);
	if (GetLevel() == 1)
	{
		pPC->SetPosY( 202.0f );
		SetRemainingEnemies(10);
		m_nBGMusicID = pWM->LoadWave("Resource/sounds/JoA_Song3.wav");
		pWM->SetVolume(m_nBGMusicID,op->GetMusicVolume() - 25);
	}
	else if (GetLevel() == 2)
	{
		pPC->SetPosY(375.0f);
		SetRemainingEnemies(10);
		m_nBGMusicID = pWM->LoadWave("Resource/sounds/JoA_Song4.wav");
		pWM->SetVolume(m_nBGMusicID,op->GetMusicVolume() - 25);
	}
	else if (GetLevel() == 3)
	{
		pPC->SetPosY(250.0f);
		SetRemainingEnemies(1);
		m_nBridgeOffsetY = 300;
		m_nBridgeVelocityY = 25 * op->GetDifficulty();
		pEM->SendEvent("spawn enemies", NULL);
		m_nBGMusicID = pWM->LoadWave("Resource/sounds/JoA_Song2.wav");
		pWM->SetVolume(m_nBGMusicID,op->GetMusicVolume() - 25);
	}
//.........这里部分代码省略.........
开发者ID:jakneute,项目名称:Earthworm-Jim-Full-Sail-Game-Project,代码行数:101,代码来源:GamePlay.cpp


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