Changed lower and upper bound (at lower speed less speed should be

lost), capped speed fraction. Tweaked parachutes parameters somewhat.
This commit is contained in:
hiker 2014-02-28 23:57:49 +11:00
parent c131312b33
commit 1903aee114
2 changed files with 19 additions and 9 deletions

@ -94,10 +94,15 @@
<!-- friction is the friction increase when a parachute is attached.
time is the time an attached parachute is active
time-other is the time a parachute attached from other kart works
lbound-fraction is the lower bound fraction of speed when lost will detach parachute
ubound-fraction is the upper bound fraction of speed when lost will detach parachute
max-speed is a factor that decides the impact of rate of speed (distance between bounds) -->
<parachute friction="2.0" time="4.0" time-other="8.0" lbound-fraction="0.5" ubound-fraction="0.95" max-speed="30"/>
lbound-fraction is the lower bound fraction of speed when lost will
detach parachute. E.g. at nearly 0 speed, only 5% of speed
need to be lost.
ubound-fraction is the upper bound fraction of speed when lost will
detach parachute. E.g. at max-speed 30% of speed must be lost.
max-speed is a factor that decides the impact of rate of speed
(distance between bounds) -->
<parachute friction="2.0" time="4.0" time-other="8.0"
lbound-fraction="0.95" ubound-fraction="0.7" max-speed="23"/>
<!-- time is the time till a bomb explodes. time-increase is the time added
to timer when bomb is passed on. -->

@ -405,18 +405,23 @@ void Attachment::update(float dt)
switch (m_type)
{
case ATTACH_PARACHUTE:
{
// Partly handled in Kart::updatePhysics
// Otherwise: disable if a certain percantage of
// initial speed was lost
// This percentage is based on the ratio of
// initial_speed / initial_max_speed
// This percentage is based on the ratio of
// initial_speed / initial_max_speed
if(m_kart->getSpeed() <= m_initial_speed * (stk_config->m_parachute_lbound_fraction +
((m_initial_speed / stk_config->m_parachute_max_speed) * (stk_config->m_parachute_ubound_fraction -
stk_config->m_parachute_lbound_fraction))))
float f = m_initial_speed / stk_config->m_parachute_max_speed;
if (f > 1.0f) f = 1.0f; // cap fraction
if (m_kart->getSpeed() <= m_initial_speed *
(stk_config->m_parachute_lbound_fraction +
f * ( stk_config->m_parachute_ubound_fraction
- stk_config->m_parachute_lbound_fraction)))
{
m_time_left = -1;
}
}
break;
case ATTACH_ANVIL: // handled in Kart::updatePhysics
case ATTACH_NOTHING: // Nothing to do, but complete all cases for switch