Applied Auria's improved bubble gum patch.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2417 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2008-11-07 04:54:38 +00:00
parent ab506f462a
commit 1651b8bba0
5 changed files with 18 additions and 8 deletions

View File

@ -100,6 +100,7 @@ void SFXManager::loadSfx()
throw std::runtime_error(msg);
}
loadSingleSfx(lisp, "ugh", SOUND_UGH );
loadSingleSfx(lisp, "skid", SOUND_SKID );
loadSingleSfx(lisp, "winner", SOUND_WINNER );
loadSingleSfx(lisp, "crash", SOUND_CRASH );
loadSingleSfx(lisp, "grab", SOUND_GRAB );

View File

@ -45,7 +45,7 @@ public:
/** The different type of sound effects. */
enum SFXType
{
SOUND_UGH, SOUND_WINNER, SOUND_CRASH, SOUND_GRAB, SOUND_SHOT, SOUND_WEE,
SOUND_UGH, SOUND_SKID, SOUND_WINNER, SOUND_CRASH, SOUND_GRAB, SOUND_SHOT, SOUND_WEE,
SOUND_EXPLOSION, SOUND_BZZT, SOUND_BEEP, SOUND_BACK_MENU, SOUND_USE_ANVIL,
SOUND_USE_PARACHUTE, SOUND_SELECT_MENU, SOUND_MOVE_MENU, SOUND_FULL,
SOUND_PRESTART, SOUND_START, SOUND_MISSILE_LOCK, SOUND_ENGINE,

View File

@ -365,15 +365,15 @@ void Kart::collectedItem(const Item &item, int add_info)
switch (type)
{
case ITEM_BANANA : m_attachment.hitBanana(item, add_info); break;
case ITEM_SILVER_COIN : m_num_items_collected++ ; break;
case ITEM_GOLD_COIN : m_num_items_collected += 3 ; break;
case ITEM_SILVER_COIN : m_num_items_collected++ ; break;
case ITEM_GOLD_COIN : m_num_items_collected += 3 ; break;
case ITEM_BONUS_BOX : {
int n=1 + 4*getNumItems() / MAX_ITEMS_COLLECTED;
m_powerup.hitBonusBox(n, item,add_info);break;
m_powerup.hitBonusBox(n, item,add_info); break;
}
case ITEM_BUBBLEGUM:
// skid
m_body->setAngularVelocity( btVector3(0,0,4) );
// slow down
m_body->setLinearVelocity(m_body->getLinearVelocity()*0.3f);
break;
default : break;
} // switch TYPE

View File

@ -46,6 +46,7 @@ PlayerKart::PlayerKart(const std::string& kart_name, int position, Player *playe
m_bzzt_sound = sfx_manager->newSFX(SFXManager::SOUND_BZZT );
m_wee_sound = sfx_manager->newSFX(SFXManager::SOUND_WEE );
m_ugh_sound = sfx_manager->newSFX(SFXManager::SOUND_UGH );
m_skid_sound = sfx_manager->newSFX(SFXManager::SOUND_SKID );
m_grab_sound = sfx_manager->newSFX(SFXManager::SOUND_GRAB );
m_full_sound = sfx_manager->newSFX(SFXManager::SOUND_FULL );
@ -56,8 +57,9 @@ PlayerKart::PlayerKart(const std::string& kart_name, int position, Player *playe
PlayerKart::~PlayerKart()
{
sfx_manager->deleteSFX(m_bzzt_sound);
sfx_manager->deleteSFX(m_wee_sound);
sfx_manager->deleteSFX(m_ugh_sound);
sfx_manager->deleteSFX(m_wee_sound );
sfx_manager->deleteSFX(m_ugh_sound );
sfx_manager->deleteSFX(m_skid_sound);
sfx_manager->deleteSFX(m_grab_sound);
sfx_manager->deleteSFX(m_full_sound);
} // ~PlayerKart
@ -305,6 +307,12 @@ void PlayerKart::collectedItem(const Item &item, int add_info)
m_ugh_sound->play();
else
m_grab_sound->play();
if(item.getType() == ITEM_BUBBLEGUM)
{
m_skid_sound->position( getXYZ() );
m_skid_sound->play();
}
}
} // collectedItem

View File

@ -43,6 +43,7 @@ private:
SFXBase *m_bzzt_sound;
SFXBase *m_wee_sound;
SFXBase *m_ugh_sound;
SFXBase *m_skid_sound;
SFXBase *m_grab_sound;
SFXBase *m_full_sound;