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

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    CRetroEngine
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    06/05/00
  8. //
  9. // Base:    CEngine
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #include "demo2.h"
  16.  
  17. //-------------------------------------------------------------
  18.  
  19. CRetroEngine::CRetroEngine()
  20. {
  21.     m_direction = RETRO_NW;
  22. }
  23.  
  24. //-------------------------------------------------------------
  25.  
  26. CRetroEngine::~CRetroEngine()
  27. {
  28. }
  29.  
  30. //-------------------------------------------------------------
  31.  
  32. bool CRetroEngine::draw()
  33. {
  34.     if (m_thrust > 0) {
  35.         switch (m_direction) {
  36.             case RETRO_NW:    animate(ANIMATE_LOOP,0,2);    break;
  37.             case RETRO_NE:    animate(ANIMATE_LOOP,2,2);    break;
  38.             case RETRO_SW:    animate(ANIMATE_LOOP,4,2);    break;
  39.             case RETRO_SE:    animate(ANIMATE_LOOP,6,2);    break;
  40.             }
  41.         CActor::draw();
  42.         }
  43.  
  44.     return true;
  45. }
  46.  
  47. //-------------------------------------------------------------
  48.  
  49. void CRetroEngine::setDirection(RetroDirection direction)
  50. {
  51.     m_direction = direction;
  52. }
  53.  
  54. //-------------------------------------------------------------
  55.