Afegits efectes de audio nous
Retocats alguns efectes de audio al afagar items per a no solapar dos audios
This commit is contained in:
@@ -467,6 +467,7 @@ void Game::checkPlayerItemCollision(std::shared_ptr<Player> &player)
|
||||
player->addScore(1000);
|
||||
const auto x = item->getPosX() + (item->getWidth() - game_text_textures_.at(0)->getWidth()) / 2;
|
||||
createItemText(x, game_text_textures_.at(0));
|
||||
JA_PlaySound(Resource::get()->getSound("itempickup.wav"));
|
||||
break;
|
||||
}
|
||||
case ItemType::GAVINA:
|
||||
@@ -474,6 +475,7 @@ void Game::checkPlayerItemCollision(std::shared_ptr<Player> &player)
|
||||
player->addScore(2500);
|
||||
const auto x = item->getPosX() + (item->getWidth() - game_text_textures_.at(1)->getWidth()) / 2;
|
||||
createItemText(x, game_text_textures_.at(1));
|
||||
JA_PlaySound(Resource::get()->getSound("itempickup.wav"));
|
||||
break;
|
||||
}
|
||||
case ItemType::PACMAR:
|
||||
@@ -481,6 +483,7 @@ void Game::checkPlayerItemCollision(std::shared_ptr<Player> &player)
|
||||
player->addScore(5000);
|
||||
const auto x = item->getPosX() + (item->getWidth() - game_text_textures_.at(2)->getWidth()) / 2;
|
||||
createItemText(x, game_text_textures_.at(2));
|
||||
JA_PlaySound(Resource::get()->getSound("itempickup.wav"));
|
||||
break;
|
||||
}
|
||||
case ItemType::DEBIAN:
|
||||
@@ -488,6 +491,7 @@ void Game::checkPlayerItemCollision(std::shared_ptr<Player> &player)
|
||||
player->addScore(100000);
|
||||
const auto x = item->getPosX() + (item->getWidth() - game_text_textures_.at(6)->getWidth()) / 2;
|
||||
createItemText(x, game_text_textures_.at(6));
|
||||
JA_PlaySound(Resource::get()->getSound("debian_pick.wav"));
|
||||
break;
|
||||
}
|
||||
case ItemType::CLOCK:
|
||||
@@ -495,6 +499,7 @@ void Game::checkPlayerItemCollision(std::shared_ptr<Player> &player)
|
||||
enableTimeStopItem();
|
||||
const auto x = item->getPosX() + (item->getWidth() - game_text_textures_.at(5)->getWidth()) / 2;
|
||||
createItemText(x, game_text_textures_.at(5));
|
||||
JA_PlaySound(Resource::get()->getSound("itempickup.wav"));
|
||||
break;
|
||||
}
|
||||
case ItemType::COFFEE:
|
||||
@@ -528,7 +533,6 @@ void Game::checkPlayerItemCollision(std::shared_ptr<Player> &player)
|
||||
}
|
||||
|
||||
updateHiScore();
|
||||
JA_PlaySound(Resource::get()->getSound("itempickup.wav"));
|
||||
item->disable();
|
||||
}
|
||||
}
|
||||
@@ -547,7 +551,24 @@ void Game::checkBulletCollision()
|
||||
tabe_->setState(TabeState::HIT);
|
||||
bullet->disable();
|
||||
auto pos = tabe_->getCollider();
|
||||
createItem(tabe_->tryToGetBonus() ? ItemType::DEBIAN : ItemType::COFFEE, pos.x, pos.y);
|
||||
if (tabe_->tryToGetBonus())
|
||||
{
|
||||
createItem(ItemType::DEBIAN, pos.x, pos.y);
|
||||
JA_PlaySound(Resource::get()->getSound("debian_drop.wav"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rand() % 3 == 0)
|
||||
{
|
||||
createItem(ItemType::COFFEE, pos.x, pos.y);
|
||||
// JA_PlaySound(Resource::get()->getSound("itemdrop.wav"));
|
||||
}
|
||||
else
|
||||
{
|
||||
// JA_PlaySound(Resource::get()->getSound("tabe_hit.wav"));
|
||||
}
|
||||
JA_PlaySound(Resource::get()->getSound("tabe_hit.wav"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user