Afegits efectes de audio nous
Retocats alguns efectes de audio al afagar items per a no solapar dos audios
This commit is contained in:
BIN
data/sound/debian_drop.wav
Normal file
BIN
data/sound/debian_drop.wav
Normal file
Binary file not shown.
BIN
data/sound/debian_pick.wav
Normal file
BIN
data/sound/debian_pick.wav
Normal file
Binary file not shown.
BIN
data/sound/tabe_hit.wav
Normal file
BIN
data/sound/tabe_hit.wav
Normal file
Binary file not shown.
@@ -415,6 +415,9 @@ void Director::setFileList()
|
||||
Asset::get()->add(prefix + "/data/sound/voice_no.wav", AssetType::SOUND);
|
||||
Asset::get()->add(prefix + "/data/sound/voice_power_up.wav", AssetType::SOUND);
|
||||
Asset::get()->add(prefix + "/data/sound/walk.wav", AssetType::SOUND);
|
||||
Asset::get()->add(prefix + "/data/sound/debian_drop.wav", AssetType::SOUND);
|
||||
Asset::get()->add(prefix + "/data/sound/debian_pick.wav", AssetType::SOUND);
|
||||
Asset::get()->add(prefix + "/data/sound/tabe_hit.wav", AssetType::SOUND);
|
||||
|
||||
// Shaders
|
||||
Asset::get()->add(prefix + "/data/shaders/crtpi_256.glsl", AssetType::DATA);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ void Tabe::updateState()
|
||||
// Intenta obtener el bonus
|
||||
bool Tabe::tryToGetBonus()
|
||||
{
|
||||
if (has_bonus_ && rand() % 10 == 0)
|
||||
if (has_bonus_ && rand() % 8 == 0)
|
||||
{
|
||||
has_bonus_ = false;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user