MagicStarParticle Class Reference

#include <magic_star.h>

Inheritance diagram for MagicStarParticle:

Inheritance graph
[legend]
Collaboration diagram for MagicStarParticle:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MagicStarParticle ()
void Refresh ()

Detailed Description

Definition at line 26 of file magic_star.h.


Constructor & Destructor Documentation

MagicStarParticle::MagicStarParticle (  ) 

Definition at line 28 of file magic_star.cpp.

00028                                      :
00029   Particle("magic_star_particle")
00030 {
00031   m_initial_time_to_live = 30;
00032   m_left_time_to_live = m_initial_time_to_live;
00033   m_time_between_scale = 25;
00034 
00035   uint color=randomObj.GetLong(0,2);
00036   switch(color)
00037   {
00038     case 0 : image = ParticleEngine::GetSprite(MAGIC_STAR_R_spr); break;
00039     case 1 : image = ParticleEngine::GetSprite(MAGIC_STAR_Y_spr); break;
00040     case 2 : image = ParticleEngine::GetSprite(MAGIC_STAR_B_spr); break;
00041     default: assert(false);
00042   }
00043   image->Scale(0.0, 0.0);
00044   SetSize( Point2i(1, 1) );
00045 }

Here is the call graph for this function:


Member Function Documentation

void MagicStarParticle::Refresh (  )  [virtual]

Reimplemented from Particle.

Definition at line 47 of file magic_star.cpp.

00048 {
00049   uint time = Time::GetInstance()->Read() - m_last_refresh;
00050   if (time >= m_time_between_scale) {
00051     if (m_left_time_to_live <= 0) return ;
00052     float lived_time = m_initial_time_to_live - m_left_time_to_live;
00053     float coeff = sin(M_PI_2*((float)lived_time/((float)m_initial_time_to_live)));
00054     image->SetRotation_rad(coeff * 2 * M_PI);
00055   }
00056   Particle::Refresh();
00057 }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 13:56:23 2007 for Wormux by  doxygen 1.4.7