#include <bullet.h>
Inheritance diagram for BulletParticle:
Public Member Functions | |
BulletParticle () | |
void | Refresh () |
void | SignalRebound () |
Private Attributes | |
int | start_to_fade |
Definition at line 26 of file bullet.h.
BulletParticle::BulletParticle | ( | ) |
Definition at line 27 of file bullet.cpp.
00027 : 00028 Particle("bullet_particle") 00029 { 00030 SetCollisionModel(false, false, false); 00031 m_rebound_sound = "weapon/grenade_bounce"; 00032 m_left_time_to_live = 1; 00033 start_to_fade = 0; 00034 00035 image = ParticleEngine::GetSprite(BULLET_spr); 00036 image->Scale(1.0,1.0); 00037 SetSize(Point2i(1, 1)); 00038 }
Here is the call graph for this function:
void BulletParticle::Refresh | ( | ) | [virtual] |
Reimplemented from Particle.
Definition at line 40 of file bullet.cpp.
00041 { 00042 if(IsOutsideWorldXY(GetPosition())) { 00043 m_left_time_to_live = 0; 00044 return; 00045 } 00046 int current_time = Time::GetInstance()->Read(); 00047 UpdatePosition(); 00048 image->Update(); 00049 if(start_to_fade > 0) { 00050 m_left_time_to_live = start_to_fade + BULLET_PARTICLE_FADE_TIME - current_time; 00051 m_left_time_to_live = (m_left_time_to_live > 0 ? m_left_time_to_live : 0); 00052 image->SetAlpha(1.0 - ((float)(current_time - start_to_fade)) / BULLET_PARTICLE_FADE_TIME); 00053 } else { 00054 // FIXME this is still a ugly hack 00055 image->SetRotation_rad((Time::GetInstance()->Read()/4) % 3 /* 3 is arbitrary */ ); 00056 } 00057 }
Here is the call graph for this function:
void BulletParticle::SignalRebound | ( | ) | [virtual] |
Reimplemented from PhysicalObj.
Definition at line 59 of file bullet.cpp.
00060 { 00061 PhysicalObj::SignalRebound(); 00062 //SetCollisionModel(true, false, false); 00063 StopMoving(); 00064 start_to_fade = Time::GetInstance()->Read(); 00065 }
Here is the call graph for this function:
int BulletParticle::start_to_fade [private] |