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

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    CWallHugger
  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_WALLHUGGER_H
  16. #define _INCLUDE_WALLHUGGER_H
  17.  
  18. #include "alien.h"
  19. #include "gs_random.h"
  20.  
  21. //-------------------------------------------------------------
  22.  
  23. const int WALLHUGGER_WALK_START = 0;
  24. const int WALLHUGGER_WALK_FRAMES = 6;
  25. const int WALLHUGGER_SHOT_START = 6;
  26. const int WALLHUGGER_SHOT_FRAMES = 8;
  27. const int WALLHUGGER_LAUNCH_FRAME = 6;
  28.  
  29. const int WALLHUGGER_LEFT = 14;
  30. const int WALLHUGGER_RIGHT = 0;
  31.  
  32. const float WALLHUGGER_STILL_TIME = 1.f;
  33. const float WALLHUGGER_WALK_TIME = 1.f;
  34.  
  35. const float WALLHUGGER_WALK_SPEED = 1.f;
  36.  
  37. //-------------------------------------------------------------
  38.  
  39. typedef enum {
  40.     WALLHUGGER_STATIC,
  41.     WALLHUGGER_MOVING,
  42. } WallHuggerGrade;
  43.  
  44. //-------------------------------------------------------------
  45.  
  46. typedef enum {
  47.     WALLHUGGER_STILL,
  48.     WALLHUGGER_WALKING,
  49.     WALLHUGGER_SHOOTING,
  50. } WallHuggerState;
  51.  
  52. //-------------------------------------------------------------
  53.  
  54. class CWallHugger : public CAlien
  55. {
  56.     private:
  57.  
  58.         CSpinnerWeapon *m_weapon;
  59.  
  60.         WallHuggerGrade m_grade;
  61.         int m_side;
  62.         int m_direction;
  63.         bool m_fired;
  64.  
  65.         WallHuggerState m_state;
  66.  
  67.         static gsCRandom m_random;
  68.  
  69.         void findWall();
  70.  
  71.         bool validWalkPosition();
  72.  
  73.     public:
  74.         CWallHugger();
  75.         ~CWallHugger();
  76.  
  77.         const ActorInfo& getActorInfo() { return ActorInfoList[INFO_WALL_HUGGER]; };
  78.  
  79.         bool activate();
  80.         void kill();
  81.  
  82.         bool update(Controls *controls);
  83.  
  84.         void setGrade(WallHuggerGrade grade);
  85. };
  86.  
  87. //-------------------------------------------------------------
  88.  
  89. #endif
  90.