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

  1. // -------- shootout.h
  2.  
  3. #ifndef SHOOTOUT_H
  4. #define SHOOTOUT_H
  5.  
  6. // ---- entrance locations
  7. enum Location {
  8.     nowhere,
  9.     window1,
  10.     window2,
  11.     window3,
  12.     window4,
  13.     window5,
  14.     housedoor,
  15.     alley2,
  16.     jaildoor,
  17.     alley3,
  18.     saloondoor,
  19.     window6,
  20.     window7,
  21.     window8
  22. };
  23.  
  24. #include <typeinfo.h>
  25. #include <theatrix.h>
  26. #include "sheriff.h"
  27. #include "doors.h"
  28. #include "digit.h"
  29. #include "menu.h"
  30.  
  31. inline int on_the_street(Location loc)
  32. {
  33.     return loc > window5 && loc < window6;
  34. }
  35.  
  36. enum Building { nobldg, house, jail, saloon };
  37.  
  38. // ---- defines entrances for bit players
  39. struct Portal {
  40.     Building building;
  41.     short int x1, y1, x2, y2;
  42.     short int occupied;
  43. };
  44.  
  45. #include "bitpart.h"
  46. #include "badguy.h"
  47.  
  48. const int maxactors = 6;
  49. const int maxbldgs = 3;
  50. const int sidewalk = 150;
  51. const int fade = 2;
  52.  
  53. class Shootout : public SceneDirector    {
  54.     Door *door1;
  55.     Door *door2;
  56.     Door *door3;
  57.     short int screenshattered;
  58.     short int certificate;
  59.     Player *finalscreen;
  60.     MusicHand *conductor;
  61.     int rticks;
  62.     int rinterval;
  63.     void on_timer();
  64.     void enteractor(BitPart *, Location);
  65.     void distribute_players();
  66.     BitPart *select_actor();
  67.     Location select_location(BitPart *);
  68.     int entrance_available(Location loc);
  69.     static Portal portals[];
  70.     static Location *entrances[];
  71.     static int entrcounts[];
  72.     BitPart *actors[maxactors];
  73.     short int actorctr;
  74.     short int badguysintown;
  75.     void display();
  76.     void hide();
  77.     const Type_info& get_next_director()
  78.         { return typeid(Menu); }
  79. public:
  80.     Shootout();
  81.     ~Shootout();
  82.     void exitstage(BitPart *bp);
  83.     Sheriff *sheriff;
  84.     Digit *bullets;
  85.     Digit *citizens;
  86.     Digit *badguys;
  87.     short int findactors(BitPart *actrs[], short int zone);
  88.     short int findactors(BitPart *actrs[], short int zone1, short int zone2);
  89.     short int isbadguy_shooting(BitPart*);
  90.     short int parsonisdead()
  91.         { return actors[2]->isdead(); }
  92.     void shatterscreen()
  93.         { screenshattered = 1; }
  94.     void deathcertificate(short int certno)
  95.         { certificate = certno; }
  96. };
  97.  
  98. const int stepct = 20;
  99. const int maxticks = 45;
  100.  
  101. #endif
  102.  
  103.