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

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    CSpinner
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    06/05/00
  8. //
  9. // Base:    CBullet
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #include "game.h"
  16.  
  17. //-------------------------------------------------------------
  18.  
  19. CSpinner::CSpinner()
  20. {
  21. }
  22.  
  23. //-------------------------------------------------------------
  24.  
  25. CSpinner::~CSpinner()
  26. {
  27. }
  28.  
  29. //-------------------------------------------------------------
  30.  
  31. bool CSpinner::activate()
  32. {
  33.     if (!isActive())
  34.         m_timer.start();
  35.  
  36.     return CActor::activate();
  37. }
  38.  
  39. //-------------------------------------------------------------
  40.  
  41. bool CSpinner::update(Controls *controls)
  42. {
  43.     if (m_shield == 0) {
  44.         kill();
  45.         return true;
  46.         }
  47.  
  48.     m_position += m_velocity;
  49.  
  50.     animate(ANIMATE_LOOP,m_grade * SPINNER_FRAMES,SPINNER_FRAMES);
  51.  
  52.     return true;
  53. }
  54.  
  55. //-------------------------------------------------------------
  56.