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


C++ Animation::SetSpeed方法代码示例

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


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

示例1: if


//.........这里部分代码省略.........
				}
				else
				{
					if ( gameState.State["Weapon"] < 1 )
					{
						anim = animAddr.Prepare("PlayerBullet");
						anim->SetPos(entity->X + entity->Width - 25, entity->Y + entity->Height / 2 - 10);
						animAddr.Fire();
					}
					else
					{
						anim = animAddr.Prepare("PlayerBullet2");
						anim->SetPos(entity->X + entity->Width - 25, entity->Y + entity->Height / 2 - 20);
						animAddr.Fire();
					}
				}

				if ( gameState.State["Addon"] >= 1 )
				{
					anim = animAddr.Prepare("PlayerAddonBullet");
					anim->SetPos(entity->X + 27, entity->Y + 50);
					animAddr.Fire();
				}
				if ( gameState.State["Addon"] >= 2 )
				{
					anim = animAddr.Prepare("PlayerAddonBullet");
					anim->SetPos(entity->X + 27, entity->Y - 15);
					animAddr.Fire();
				}
				SoundManager::GetSingleton().Play("Shoot");
				part = particleAddr.Prepare("BulletShell");
				part->SetPos(entity->X + entity->Width - 25, entity->Y + entity->Height / 2 - 10);
				part->RotSpeed = (float)Helper::Random(15, 30);
				part->SetSpeed((float)-Helper::Random(50, 90), (float)130, (float)-Helper::Random(100, 200), (float)Helper::Random(200, 300));
				particleAddr.Fire();

				bulletCount++;
			}
		}
		if ( entity->Params["Crashed"] == "True" )
		{
			SoundManager::GetSingleton().Play("Explode");
			anim = animAddr.Prepare("Explosion");
			anim->SetPos(entity->X - 50, entity->Y - 60);
			animAddr.Fire();
			gameState.State["Score"] -= 10000;
			gameState.State["Life"]--;
			gameState.InitWeapons();
			AddNewPlayer();
			entity->Params["Delete"] = "True";
		}
	}
#pragma endregion PlayerPlane, and shootin mah bullets
#pragma region PlayerBoat
	if ( entity->Params["Name"] == "PlayerBoat" )
	{

		if ( !gameState.State["PlayerMode"] )
		{
			entity->Params["Switching"] = "True";
			//gameState.State["MaxHealth"] = 999999999;
			entity->Health = 999999999;
		}
		else
		{
			entity->Health = 1;
开发者ID:iAmGhost,项目名称:Dokdo_Pasta,代码行数:67,代码来源:Stage_Stage3.cpp

示例2: Entity

void Stage_Stage3::Init()
{
	stageOverTimer = 0;
	boatTimer = 0;
	stageClearTimer = 0;
	bulletCount = 0;
	GameStateManager::GetSingleton().Init();
	Entity *newEntity;

#pragma region Texture
	TextureManager& tm = TextureManager::GetSingleton();
	tm.Add(T_BACKGROUND_1);
	tm.Add(T_BACKGROUND_2);
	tm.Add(T_BACKGROUND_3);
	tm.Add(T_BACKGROUND_4);
	tm.Add(T_BACKGROUND_5);
	tm.Add(T_ENEMY_1);
	tm.Add(T_ENEMY_2);
	tm.Add(T_ENEMY_3);
	tm.Add(T_ENEMY_BOAT);
	tm.Add(T_ENEMY_BOSS);
	tm.Add(T_EXPLOSION);
	tm.Add(T_EXPLOSION_BIG);
	tm.Add(T_PLAYER);
	tm.Add(T_PLAYER_BOAT);
	tm.Add(T_PLAYER_ADDON);
	tm.Add(T_BULLET);
	tm.Add(T_BOAT_BULLET);
	tm.Add(T_BULLET_2);
	tm.Add(T_BULLET2_EXPLOSION);
	tm.Add(T_BULLET_SHELL);
	tm.Add(T_BULLET_EXPLOSION);
	tm.Add(T_UI_BACKGROUND_1);
	tm.Add(T_UI_BACKGROUND_2);
	tm.Add(T_UI_BAR_HEALTH);
	tm.Add(T_UI_BAR_EXP);
	tm.Add(T_UI_SHOP_POWER);
	tm.Add(T_UI_SHOP_MORESPEED);
	tm.Add(T_UI_SHOP_SPEED);
	tm.Add(T_UI_SHOP_ADDON);
	tm.Add(T_UI_SHOP_WEAPON);
	tm.Add(T_UI_BAR_BOSS);
	tm.Add(T_UI_GAMEOVER);
	tm.Add(T_UI_BAR_BOSS_BG);
	tm.Add(T_UI_BAR_BOSS_BG_BLACK);
	tm.Add(T_UI_CLEAR);
	tm.Add(T_DOKDO);
	tm.Add(T_HP);
	tm.Init();
#pragma endregion Texture
#pragma region Background
	newEntity = new Entity(T_BACKGROUND_1, 800, 600);
	newEntity->SetPos(0, 0);
	entities.push_back(newEntity);

	newEntity = new Entity(T_DOKDO, 454, 209);
	newEntity->SetPos(200, 300);
	newEntity->Params["Name"] = "Dokdo";
	newEntity->SetSpeed(-30, 0, 0, 0);
	entities.push_back(newEntity);

	newEntity = new Entity(T_BACKGROUND_2, 1600, 600);
	newEntity->SetPos(0, 0);
	newEntity->Params["Type"] = "ScrollingBackground";
	newEntity->SetSpeed(-150, 0, 0, 0);
	entities.push_back(newEntity);

	newEntity = new Entity(T_BACKGROUND_3, 1600, 600);
	newEntity->SetPos(0, 0);
	newEntity->Params["Type"] = "ScrollingBackground";
	newEntity->SetSpeed(-200, 0, 0, 0);
	entities.push_back(newEntity);

	newEntity = new Entity(T_BACKGROUND_4, 1600, 600);
	newEntity->SetPos(0, 0);
	newEntity->Params["Type"] = "ScrollingBackground";
	newEntity->SetSpeed(-250, 0, 0, 0);
	entities.push_back(newEntity);

	newEntity = new Entity(T_BACKGROUND_5, 1600, 600);
	newEntity->SetPos(0, 0);
	newEntity->Params["Type"] = "ScrollingBackground";
	newEntity->SetSpeed(-300, 0, 0, 0);
	entities.push_back(newEntity);
#pragma endregion Background
#pragma region Player
	AddNewPlayer();
	AddNewPlayerBoat();

	Animation *newAddon = new Animation(T_PLAYER_ADDON, 150, 17, 1, 6);
	newAddon->Params["Type"] = "PlayerAddon";
	newAddon->Params["Name"] = "AddonUpper";
	newAddon->Play(30.0f, true);
	entities.push_back(newAddon);

	newAddon = new Animation(T_PLAYER_ADDON, 150, 17, 1, 6);
	newAddon->Params["Type"] = "PlayerAddon";
	newAddon->Params["Name"] = "AddonLower";
	newAddon->Play(30.0f, true);
	entities.push_back(newAddon);
//.........这里部分代码省略.........
开发者ID:iAmGhost,项目名称:Dokdo_Pasta,代码行数:101,代码来源:Stage_Stage3.cpp


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