Now each items that explode had it's own explosion
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12974 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
cceed70e09
commit
55edd4d38b
@ -34,14 +34,14 @@
|
|||||||
const float burst_time = 0.1f;
|
const float burst_time = 0.1f;
|
||||||
|
|
||||||
/** Creates an explosion effect. */
|
/** Creates an explosion effect. */
|
||||||
Explosion::Explosion(const Vec3& coord, const char* explosion_sound)
|
Explosion::Explosion(const Vec3& coord, const char* explosion_sound, const char * particle_file)
|
||||||
: HitSFX(coord, explosion_sound)
|
: HitSFX(coord, explosion_sound)
|
||||||
{
|
{
|
||||||
// short emision time, explosion, not constant flame
|
// short emision time, explosion, not constant flame
|
||||||
m_remaining_time = burst_time;
|
m_remaining_time = burst_time;
|
||||||
|
|
||||||
ParticleKindManager* pkm = ParticleKindManager::get();
|
ParticleKindManager* pkm = ParticleKindManager::get();
|
||||||
ParticleKind* particles = pkm->getParticles("explosion.xml");
|
ParticleKind* particles = pkm->getParticles(particle_file);
|
||||||
m_emitter = new ParticleEmitter(particles, coord, NULL);
|
m_emitter = new ParticleEmitter(particles, coord, NULL);
|
||||||
} // Explosion
|
} // Explosion
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ private:
|
|||||||
ParticleEmitter* m_emitter;
|
ParticleEmitter* m_emitter;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Explosion(const Vec3& coord, const char* explosion_sound);
|
Explosion(const Vec3& coord, const char* explosion_sound, const char * particle_file );
|
||||||
~Explosion();
|
~Explosion();
|
||||||
bool updateAndDelete(float delta_t);
|
bool updateAndDelete(float delta_t);
|
||||||
bool hasEnded () { return m_remaining_time <= -explosion_time; }
|
bool hasEnded () { return m_remaining_time <= -explosion_time; }
|
||||||
|
@ -222,7 +222,7 @@ void Attachment::hitBanana(Item *item, int new_attachment)
|
|||||||
case ATTACH_BOMB:
|
case ATTACH_BOMB:
|
||||||
{
|
{
|
||||||
add_a_new_item = false;
|
add_a_new_item = false;
|
||||||
HitEffect *he = new Explosion(m_kart->getXYZ(), "explosion");
|
HitEffect *he = new Explosion(m_kart->getXYZ(), "explosion", "explosion_bomb.xml");
|
||||||
if(m_kart->getController()->isPlayerController())
|
if(m_kart->getController()->isPlayerController())
|
||||||
he->setPlayerKartHit();
|
he->setPlayerKartHit();
|
||||||
projectile_manager->addHitEffect(he);
|
projectile_manager->addHitEffect(he);
|
||||||
@ -397,7 +397,7 @@ void Attachment::update(float dt)
|
|||||||
}
|
}
|
||||||
if(m_time_left<=0.0)
|
if(m_time_left<=0.0)
|
||||||
{
|
{
|
||||||
HitEffect *he = new Explosion(m_kart->getXYZ(), "explosion");
|
HitEffect *he = new Explosion(m_kart->getXYZ(), "explosion", "explosion_bomb.xml");
|
||||||
if(m_kart->getController()->isPlayerController())
|
if(m_kart->getController()->isPlayerController())
|
||||||
he->setPlayerKartHit();
|
he->setPlayerKartHit();
|
||||||
projectile_manager->addHitEffect(he);
|
projectile_manager->addHitEffect(he);
|
||||||
|
@ -512,7 +512,7 @@ void Flyable::explode(AbstractKart *kart_hit, PhysicalObject *object,
|
|||||||
*/
|
*/
|
||||||
HitEffect* Flyable::getHitEffect() const
|
HitEffect* Flyable::getHitEffect() const
|
||||||
{
|
{
|
||||||
return new Explosion(getXYZ(), "explosion");
|
return new Explosion(getXYZ(), "explosion", "explosion_cake.xml");
|
||||||
} // getHitEffect
|
} // getHitEffect
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
@ -308,7 +308,7 @@ void Swatter::squashThingsAround()
|
|||||||
if (kart->getAttachment()->getType()==Attachment::ATTACH_BOMB)
|
if (kart->getAttachment()->getType()==Attachment::ATTACH_BOMB)
|
||||||
{ // make bomb explode
|
{ // make bomb explode
|
||||||
kart->getAttachment()->update(10000);
|
kart->getAttachment()->update(10000);
|
||||||
HitEffect *he = new Explosion(m_kart->getXYZ(), "explosion");
|
HitEffect *he = new Explosion(m_kart->getXYZ(), "explosion", "explosion.xml");
|
||||||
if(m_kart->getController()->isPlayerController())
|
if(m_kart->getController()->isPlayerController())
|
||||||
he->setPlayerKartHit();
|
he->setPlayerKartHit();
|
||||||
projectile_manager->addHitEffect(he);
|
projectile_manager->addHitEffect(he);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user