Renamed 'slowdown' for terrain specific max speed to slowdown-time.
Made slowdown in tuxtollway less abrupt. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6296 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -62,7 +62,7 @@ Material::Material(const XMLNode *node, int index)
|
||||
node->get("zipper", &m_zipper );
|
||||
node->get("reset", &m_resetter );
|
||||
node->get("max-speed", &m_max_speed_fraction);
|
||||
node->get("slowdown", &m_slowdown_severity );
|
||||
node->get("slowdown-time", &m_slowdown_time );
|
||||
node->get("anisotropic", &m_anisotropic );
|
||||
node->get("backface-culling", &m_backface_culling );
|
||||
std::string s("");
|
||||
@@ -132,7 +132,7 @@ void Material::init(unsigned int index)
|
||||
m_zipper = false;
|
||||
m_resetter = false;
|
||||
m_max_speed_fraction = 1.0f;
|
||||
m_slowdown_severity = 1.0f;
|
||||
m_slowdown_time = 1.0f;
|
||||
m_sfx_name = "";
|
||||
m_sfx_min_speed = 0.0f;
|
||||
m_sfx_max_speed = 30;
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
bool m_lightmap;
|
||||
float m_friction;
|
||||
/** How much the top speed is reduced per second. */
|
||||
float m_slowdown_severity;
|
||||
float m_slowdown_time;
|
||||
/** Maximum speed at which no more slow down occurs. */
|
||||
float m_max_speed_fraction;
|
||||
/** The minimum speed at which a special sfx is started to be played. */
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
/** Returns how long it will take for a slowdown to take effect.
|
||||
* It is the time it takes till the full slowdown applies to
|
||||
* karts. So a short time will slowdown a kart much faster. */
|
||||
float getSlowDownSeverity() const { return m_slowdown_severity; }
|
||||
float getSlowDownTime() const { return m_slowdown_time; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns true if this material should have smoke effect. */
|
||||
bool hasSmoke () const { return m_graphical_effect==GE_SMOKE;}
|
||||
|
||||
@@ -809,8 +809,7 @@ void Kart::update(float dt)
|
||||
if(m_current_speed_fraction<=material->getMaxSpeedFraction())
|
||||
m_current_speed_fraction = material->getMaxSpeedFraction();
|
||||
else
|
||||
m_current_speed_fraction -=
|
||||
dt/material->getSlowDownSeverity();
|
||||
m_current_speed_fraction -= dt/material->getSlowDownTime();
|
||||
}
|
||||
} // if there is material
|
||||
|
||||
|
||||
Reference in New Issue
Block a user