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

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    CBossControl
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    06/05/00
  8. //
  9. // Base:    CBoss
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_BOSSCONTROL_H
  16. #define _INCLUDE_BOSSCONTROL_H
  17.  
  18. #include "boss.h"
  19.  
  20. //-------------------------------------------------------------
  21.  
  22. typedef enum
  23. {
  24.     BOSS_MOVE_DOWN,
  25.     BOSS_STATIC,
  26.     BOSS_MOVE_UP,
  27.     BOSS_BEGIN_LOOP,
  28.     BOSS_END_LOOP,
  29.     BOSS_TRIGGER,
  30.     BOSS_DESTROY,
  31.     BOSS_ROAR,
  32.     BOSS_SNORT,
  33.     BOSS_DEAD,
  34.     BOSS_OPEN_EYES,
  35.     BOSS_SHUT_EYES,
  36. } BossState;
  37.  
  38. //-------------------------------------------------------------
  39.  
  40. struct BossScriptItem
  41. {
  42.     BossState m_state;
  43.     int m_param;
  44. };
  45.  
  46. //-------------------------------------------------------------
  47.  
  48. class CBossControl : public CBoss
  49. {
  50.     private:
  51.         static bool m_is_started;
  52.         static int m_yscroll;
  53.  
  54.         BossState m_state;
  55.         int m_counter;
  56.  
  57.         static BossScriptItem m_script[];
  58.         BossScriptItem *m_script_pointer;
  59.         BossScriptItem *m_loop_point;
  60.  
  61.         void interpretScript();
  62.  
  63.         gsCPoint m_tile_pos;
  64.         int m_size;
  65.         gsCTimer m_destruction_timer;
  66.  
  67.         void explodeTile(const gsCPoint& pos);
  68.  
  69.         void initiateDestructionSequence();
  70.         void updateDestructionSequence();
  71.  
  72.     public:
  73.         CBossControl();
  74.         virtual ~CBossControl();
  75.  
  76.         const ActorInfo& getActorInfo() { return ActorInfoList[INFO_BOSSCONTROL]; };
  77.  
  78.         bool activate();
  79.         void kill();
  80.         bool update(Controls *controls);
  81.  
  82.         static int getYScroll();
  83.  
  84.         static bool isStarted();
  85. };
  86.  
  87. //-------------------------------------------------------------
  88.  
  89. #endif
  90.