本文整理汇总了C++中SoundPlayer::AddToPlay方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundPlayer::AddToPlay方法的具体用法?C++ SoundPlayer::AddToPlay怎么用?C++ SoundPlayer::AddToPlay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundPlayer
的用法示例。
在下文中一共展示了SoundPlayer::AddToPlay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateMap
bool UpdateMap(std::shared_ptr<VisibleObject> &player,
std::vector<std::shared_ptr<VisibleObject> > &objectVec, Map &map,
unsigned int &score, SoundPlayer &soundPlayer,
ResourceManager &resMan)
{
bool powerPill(false);
glm::ivec2 where((int)(player->GetX()),
(int)(player->GetY()));
Object obj(map.GetWhichObject(where));
if(obj == Object::tree || obj == Object::powerPill || obj == Object::specialObject)
{
UpdateObject(where, map, player->GetPlayer(), objectVec);
switch(obj)
{
case Object::tree:
score += 10;
soundPlayer.AddToPlay(*(resMan.GetSound("chop.ogg")));
break;
case Object::powerPill:
score += 10;
soundPlayer.AddToPlay(*(resMan.GetSound("chainsaw.ogg")));
powerPill = true;
break;
case Object::specialObject:
soundPlayer.AddToPlay(*(resMan.GetSound("woodpile.ogg")));
score += 100;
break;
default:
break;
}
}
return powerPill;
}