home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / xenon / source / smokeeffect.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-15  |  792 b   |  39 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    CSmokeEffect
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    06/05/00
  8. //
  9. // Base:    CParticleEffect
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #include "game.h"
  16.  
  17. //-------------------------------------------------------------
  18.  
  19. Particle *CSmokeEffect::createParticle()
  20. {
  21.     if (m_timer.getTime() > 0.1f) {
  22.         m_timer.start();
  23.  
  24.         Particle *p = new Particle;
  25.  
  26.         p->m_position = getPosition();
  27.         p->m_velocity = gsCVector::polar(1.0f,m_random.getFloat(360.f)) + gsCVector(0.f,1.f);
  28.         p->m_age = 0.f;
  29.         p->m_lifetime = 1.f;
  30.         p->m_mass = 1.f;
  31.  
  32.         return p;
  33.         }
  34.     else
  35.         return 0;
  36. }
  37.  
  38. //-------------------------------------------------------------
  39.