home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / thx / demos / shootout / build / bitpart.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-06  |  1.5 KB  |  84 lines

  1. // -------------- bitpart.h
  2.  
  3. #ifndef BITPART_H
  4. #define BITPART_H
  5.  
  6. #include "shootout.h"
  7.  
  8. const int waitcount = 100;
  9. const int forwardsteps = 9;
  10. const int stepincr = 2;
  11. const int bpwalkinterval = 4;
  12. const int bpshootinterval = 4;
  13.  
  14. class BitPart : public Player    {
  15. protected:
  16.     enum Mode    {
  17.         inactive,
  18.         entrance,
  19.         standing,
  20.         exiting,
  21.         aiming,
  22.         shooting,
  23.         yelling,
  24.         die,
  25.         dying,
  26.         applauding,
  27.         dead
  28.     };
  29.     Mode mode;
  30. private:
  31.     Location location;
  32.     Door *door;
  33.     short int steps;
  34.     short int noactivity;
  35.     Portal clipper;
  36.     short int enterright;
  37.     short int exitright;
  38.     void make_entrance();
  39.     void hit_the_mark();
  40.     void exit_stage();
  41.     void swan_song();
  42.     void fall();
  43.     void applaud();
  44.     friend class Shootout;
  45. public:
  46.     BitPart(char *gfxfile);
  47.     virtual ~BitPart();
  48.     virtual void initialize_bitpart();
  49.     virtual void update_position();
  50.     void enter(Portal cl, Door *dr, Location loc);
  51.     void getshot();
  52.     short int zone();
  53.     virtual int iscitizen()
  54.         { return 1; }
  55.     int isshooting()
  56.         { return mode == shooting || mode == aiming; }
  57.     int isdead()
  58.         { return mode == die || mode == dying || mode == dead; }
  59. };
  60.  
  61. class Sadie : public BitPart    {
  62. public:
  63.     Sadie() : BitPart("sadie.gfx")
  64.         { }
  65.     virtual ~Sadie() { }
  66. };
  67.  
  68. class Parson : public BitPart    {
  69. public:
  70.     Parson() : BitPart("parson.gfx")
  71.         { }
  72.     virtual ~Parson() { }
  73. };
  74.  
  75. class Deputy : public BitPart    {
  76. public:
  77.     Deputy() : BitPart("deputy.gfx")
  78.         { }
  79.     virtual ~Deputy() { }
  80. };
  81.  
  82. #endif
  83.  
  84.