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

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    CHomerProjectile
  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. CHomerProjectile::CHomerProjectile()
  20. {
  21. }
  22.  
  23. //-------------------------------------------------------------
  24.  
  25. CHomerProjectile::~CHomerProjectile()
  26. {
  27. }
  28.  
  29. //-------------------------------------------------------------
  30.  
  31. bool CHomerProjectile::update(Controls *controls)
  32. {
  33.     if (m_shield == 0) {
  34.         explode();
  35.         kill();
  36.         return true;
  37.         }
  38.  
  39.     m_position += m_velocity;
  40.  
  41.     int num_frames = m_image->getNumTiles();
  42.  
  43.     m_sprite.setFrame((getDirection(num_frames) + 3) & (num_frames - 1));
  44.  
  45.     return true;
  46. }
  47.  
  48. //-------------------------------------------------------------
  49.