IllBubble Class Reference

#include <ill_bubble.h>

Inheritance diagram for IllBubble:

Inheritance graph
[legend]
Collaboration diagram for IllBubble:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 IllBubble ()
void Draw ()

Private Attributes

uint vib_phi

Detailed Description

Definition at line 26 of file ill_bubble.h.


Constructor & Destructor Documentation

IllBubble::IllBubble (  ) 

Definition at line 31 of file ill_bubble.cpp.

00031                      : ExplosionSmoke(20)
00032 {
00033   // delete the sprite of the ExplosionSmoke
00034   delete image;
00035   image = ParticleEngine::GetSprite(ILL_BUBBLE_spr);
00036   SetAirResistFactor( GetAirResistFactor() * 3.0 );
00037   vib_phi = randomObj.GetLong(0, vib_period);
00038 }

Here is the call graph for this function:


Member Function Documentation

void IllBubble::Draw (  )  [virtual]

Reimplemented from ExplosionSmoke.

Definition at line 40 of file ill_bubble.cpp.

00041 {
00042   if (m_left_time_to_live > m_initial_time_to_live - 3)
00043     image->SetAlpha( (float)(m_initial_time_to_live - m_left_time_to_live) / 3.0 );
00044   else
00045     image->SetAlpha(1.0);
00046 
00047   uint time = (Time::GetInstance()->Read() + vib_phi) % vib_period;
00048   float scale_x, scale_y;
00049   image->GetScaleFactors(scale_x, scale_y);
00050   scale_x *= 1.0 + 0.2 * sin(2.0 * M_PI * time / (float)vib_period);
00051   scale_y *= 1.0 + 0.2 * cos(2.0 * M_PI * time / (float)vib_period);
00052   image->Scale(scale_x, scale_y);
00053 
00054   if (m_left_time_to_live > 0)
00055     image->Draw(GetPosition()+Point2i(dx,0) - image->GetSize() / 2);
00056 }

Here is the call graph for this function:


Member Data Documentation

uint IllBubble::vib_phi [private]

Definition at line 29 of file ill_bubble.h.


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