Tweak zippers to give less motion blur, and start adding some fire coming out of the kart which atm only really works for ground zippers

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9457 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2011-08-10 02:02:12 +00:00
parent ca4bffe34d
commit 39e5d9ef53
4 changed files with 18 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ void PostProcessing::update(float dt)
{
if (m_boost_amount > 0.0f)
{
m_boost_amount -= dt*5.0f;
m_boost_amount -= dt*3.5f;
if (m_boost_amount < 0.0f) m_boost_amount = 0.0f;
}
}
@@ -137,7 +137,7 @@ void PostProcessing::render()
/** Set the boost amount according to the speed of the camera */
void PostProcessing::giveBoost()
{
m_boost_amount = 5.0f;
m_boost_amount = 2.5f;
//printf("setCameraSpeed(%f)\n", cam_speed);
//m_boost_amount = core::clamp(MOTION_BLUR_FACTOR * (cam_speed - MOTION_BLUR_OFFSET), 0.0f, 1.0f);
}

View File

@@ -391,6 +391,8 @@ void PlayerController::handleZipper(bool play_sound)
// Apply the motion blur according to the speed of the kart
irr_driver->getPostProcessing()->giveBoost();
m_kart->showZipperFire();
} // handleZipper
//-----------------------------------------------------------------------------

View File

@@ -902,7 +902,10 @@ void Kart::update(float dt)
if (material->isDriveReset() && isOnGround())
forceRescue();
else if(material->isZipper() && isOnGround())
{
handleZipper(material);
showZipperFire();
}
else
{
MaxSpeed::setSlowdown(MaxSpeed::MS_DECREASE_TERRAIN,
@@ -953,6 +956,16 @@ void Kart::update(float dt)
}
} // update
//-----------------------------------------------------------------------------
/**
* Show fire to go with a zipper
*/
void Kart::showZipperFire()
{
m_nitro->setCreationRate(800.0f);
}
//-----------------------------------------------------------------------------
/** Squashes this kart: it will scale the kart in up direction, and causes
* a slowdown while this kart is squashed.

View File

@@ -239,6 +239,7 @@ public:
virtual void update (float dt);
virtual void finishedRace (float time);
void beep ();
void showZipperFire ();
bool playCustomSFX (unsigned int type);
void setController(Controller *controller);
// ------------------------------------------------------------------------