home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / demo4 / rusher.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-12  |  1.1 KB  |  65 lines

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