home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / xenon / includes / organicgun.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-08  |  1.4 KB  |  74 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    COrganicGun
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    06/05/00
  8. //
  9. // Base:    CAlien
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_ORGANICGUN_H
  16. #define _INCLUDE_ORGANICGUN_H
  17.  
  18. #include "alien.h"
  19. #include "gs_random.h"
  20.  
  21. //-------------------------------------------------------------
  22.  
  23. const int ORGANICGUN_SHOT_START = 0;
  24. const int ORGANICGUN_SHOT_FRAMES = 8;
  25. const int ORGANICGUN_LAUNCH_FRAME = 6;
  26.  
  27. const int ORGANICGUN_LEFT = 0;
  28. const int ORGANICGUN_RIGHT = 8;
  29.  
  30. const float ORGANICGUN_STILL_TIME = 1.f;
  31.  
  32. //-------------------------------------------------------------
  33.  
  34. typedef enum {
  35.     ORGANICGUN_STILL,
  36.     ORGANICGUN_SHOOTING,
  37. } OrganicGunState;
  38.  
  39. //-------------------------------------------------------------
  40.  
  41. class COrganicGun : public CAlien
  42. {
  43.     private:
  44.  
  45.         CSpinnerWeapon *m_weapon;
  46.  
  47.         int m_side;
  48.         int m_direction;
  49.         bool m_fired;
  50.  
  51.         OrganicGunState m_state;
  52.  
  53.         static gsCRandom m_random;
  54.  
  55.     public:
  56.         COrganicGun();
  57.         ~COrganicGun();
  58.  
  59.         const ActorInfo& getActorInfo() { return ActorInfoList[INFO_ORGANIC_GUN]; };
  60.  
  61.         bool activate();
  62.         void kill();
  63.  
  64.         void setDirection(int dir);
  65.  
  66.         void onLeavingScreen();
  67.  
  68.         bool update(Controls *controls);
  69. };
  70.  
  71. //-------------------------------------------------------------
  72.  
  73. #endif
  74.