Add key to get free nitro + minor tweaks to particle code

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7290 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-01-06 01:01:12 +00:00
parent f11b67eacc
commit 3eeca13ce3
3 changed files with 16 additions and 6 deletions

View File

@ -68,7 +68,7 @@ ParticleEmitter::ParticleEmitter(ParticleKind* type, core::vector3df position,
{
// FIXME: does the maxAngle param work at all??
// FIXME: the min and max color params don't appear to work
m_emitter = m_node->createPointEmitter(core::vector3df(0.0f, 0.0f, 0.0f), // velocity in m/ms
m_emitter = m_node->createPointEmitter(core::vector3df(0.0f, 0.0f, 5.0f), // velocity in m/ms
type->getMinRate(), type->getMaxRate(),
type->getMinColor(), type->getMaxColor(),
lifeTimeMin, lifeTimeMax,
@ -87,7 +87,7 @@ ParticleEmitter::ParticleEmitter(ParticleKind* type, core::vector3df position,
m_node->setPosition(core::vector3df(position.X + box_x, position.Y + box_y, position.Z + box_z));
m_emitter = m_node->createBoxEmitter(core::aabbox3df(-box_x, -box_y, -box_z,
box_x, box_y, box_z),
core::vector3df(0.0f, 0.0f, 0.0f), // velocity in m/ms
core::vector3df(0.0f, 0.0f, 5.0f), // velocity in m/ms
type->getMinRate(), type->getMaxRate(),
type->getMinColor(), type->getMaxColor(),
lifeTimeMin, lifeTimeMax,
@ -110,7 +110,7 @@ ParticleEmitter::ParticleEmitter(ParticleKind* type, core::vector3df position,
// FIXME: this is ridiculous, the fadeout time should be equal to the lifetime, except that the
// lifetime is random...
scene::IParticleFadeOutAffector *af = m_node->createFadeOutParticleAffector(video::SColor(0, 0, 0, 0),
scene::IParticleFadeOutAffector *af = m_node->createFadeOutParticleAffector(video::SColor(0, 255, 255, 255),
type->getFadeoutTime());
m_node->addAffector(af);
af->drop();

View File

@ -171,10 +171,18 @@ void InputManager::handleStaticAction(int key, int value)
break;
case KEY_F8:
if(value && control_is_pressed)
if(value)
{
RaceGUIBase* gui = World::getWorld()->getRaceGUI();
if (gui != NULL) gui->m_enabled = !gui->m_enabled;
if (control_is_pressed)
{
RaceGUIBase* gui = World::getWorld()->getRaceGUI();
if (gui != NULL) gui->m_enabled = !gui->m_enabled;
}
else
{
Kart* kart = world->getLocalPlayerKart(0);
kart->setEnergy(100.0f);
}
}
break;

View File

@ -398,6 +398,8 @@ public:
* the upright constraint to allow for more realistic explosions. */
bool isNearGround () const;
// ------------------------------------------------------------------------
void setEnergy (float val) { m_collected_energy = val; }
};