home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / XBD2_SRC.ZIP / XBD2_SRC / XBD.H < prev    next >
C/C++ Source or Header  |  1991-02-10  |  4KB  |  180 lines

  1. /*********************************************/
  2. /* you just keep on pushing my luck over the */
  3. /*           BOULDER        DASH             */
  4. /*                                           */
  5. /*     Jeroen Houttuin, ETH Zurich, 1990     */
  6. /*                                           */
  7. /*                                           */
  8. /*      PC-VGA version from :                */
  9. /*                                           */
  10. /*        Herve SOULARD, Paris, 1990        */
  11. /*                                           */
  12. /*********************************************/
  13.  
  14.  
  15. #include "sound.h"
  16.  
  17.  
  18. #ifndef _XBD_H_
  19.  
  20. #define _XBD_H_
  21.  
  22. #define w                35
  23. #define h                26
  24. #define LEVELPREFIX        "xbdlv"
  25.  
  26. #define SCORESIZE        18
  27. #define LIB            ".\\lib"
  28.  
  29. /* direction masks */
  30. #define N                 0
  31. #define E                 1
  32. #define S                 2
  33. #define W                 3
  34. #define NODIR             4
  35.  
  36. #define SPACEEXPLO         0
  37. #define BOULDEXPLO        10
  38. #define DIAEXPLO        20
  39. #define PROPAGATED        10
  40.  
  41. #define PLAYER            'p'
  42. #define SPACE            ' '
  43. #define LMONSTER        'l'    /* Right turning monster */
  44. #define RMONSTER        'r'
  45. #define GRASS            'g'
  46. #define WALL            'w'
  47. #define MAGICWALL        'W'    /* Expanding wall */
  48. #define DIAMOND        'd'
  49. #define STEEL            'S'
  50. #define BOULDER        'b'
  51. #define EXPLOSION        'x'
  52. #define EXIT            'E'
  53. #define EATER            'e'
  54. #define NUCBAL            'n'    /* Nuclear ballon */
  55. #define BLOB            'B'    /* lava */
  56. #define TINKLE            't'    /* Tinkle wall */
  57.  
  58. #define NB_EDIT_PGM        16
  59.  
  60. #define K_question        '?'
  61. #define K_slash        '/'
  62.  
  63. #ifndef byte
  64. #define byte    unsigned char
  65. #endif
  66.  
  67. #define ALT_SHIFT         8
  68. #define CTL_SHIFT         4
  69. #define LEFT_SHIFT         2
  70. #define RIGHT_SHIFT         1
  71.  
  72. #define K_HOME            71
  73. #define K_END            79
  74. #define K_UP            72
  75. #define K_DOWN            80
  76. #define K_PGUP            73
  77. #define K_PGDOWN        81
  78. #define K_LEFT            75
  79. #define K_RIGHT        77
  80. #define K_INS            82
  81. #define K_DEL            83
  82. #define K_BACKSPACE         8
  83. #define K_RETURN        13
  84. #define K_ESC            27
  85. #define K_SPACE        32
  86.  
  87. #define K_CTL_UP        141
  88. #define K_CTL_DOWN        145
  89. #define K_CTL_LEFT        115
  90. #define K_CTL_RIGHT        116
  91.  
  92.  
  93. #define K_F1            59
  94. #define K_F2            60
  95. #define K_F3            61
  96. #define K_F4            62
  97. #define K_F5            63
  98. #define K_F6            64
  99. #define K_F7            65
  100. #define K_F8            66
  101. #define K_F9            67
  102. #define K_F10            68
  103.  
  104. #define K_C            'C'
  105. #define K_U            'U'
  106. #define K_c            'c'
  107. #define K_u            'u'
  108. #define K_backslash        'b'
  109. #define K_D            'D'
  110. #define K_d            'd'
  111. #define K_R            'R'
  112. #define K_r            'r'
  113.  
  114.  
  115.  
  116. static int  far *kbdStatus   = (int  far *)0x00000417;  /* Etat du clavier */
  117. static byte far *kbdBuffer   = (byte far *)0x00000400;  /* Tampon clavier  */
  118. static int  far *kbdPtrRead  = (int  far *)0x0000041A;  /* Ptr lecture     */
  119. static int  far *kbdPtrWrite = (int  far *)0x0000041C;  /* Ptr écriture    */
  120.  
  121.  
  122. #define Bool            enum Boolean
  123. enum Boolean {
  124.     FALSE, TRUE
  125. };
  126.  
  127.  
  128.  
  129. char        *gc, *Bgc, *Bgc1, *Bgc2, *ngc, *egc, *egc1, *egc2, *Egc1, *Wgc,
  130.         *Wgc2, *Egc2, *Egc, *lgc, *lgc1, *lgc2, *rgc, *rgc1, *rgc2, *xgc,
  131.         *Sgc, *bgc, *dgc, *dgc1, *dgc2, *wgc, *pgc, *pgc1, *pgc2, *sgc,
  132.         *ggc, *tgc, *tgc1, *tgc2, *tgc3;
  133.  
  134. char        filename[300];    /* Current file name of this level */
  135. char        levname[64];    /* Levelname */
  136. int        i, j, ii, jj, jjj;
  137. int        blobbreak;
  138. int        critical;
  139. int        curtime;        /* Current clock tick number */
  140. int        blobcells;
  141. int        tinkdur;        /* Tinkle duration */
  142. Bool        tinkact;        /* Tinkle active   */
  143. Bool        levincreased;
  144. int        x, y, xin, yin, players, lives, levelnum, levelstart, speed,
  145.         diareq, diapoints, extradiapoints;
  146. Bool        steal;        /* steal instead of go */
  147. Bool        stoplevel, blobcollapse;
  148.  
  149. enum directs {
  150.     STAND, UP, DOWN, LEFT, RIGHT, KILL
  151. };
  152.  
  153. enum directs    curorder;    /* Current order which player has */
  154.                         /* typed at the keyboard. */
  155.  
  156. struct cell {
  157.   char    content;
  158.   Bool    changed;            /* has cell changed since last drawing */
  159.   Bool    caught;            /* for BLOB */
  160.   Bool    checked;            /* for BLOB algorithm */
  161.   char    dir;
  162.   short    speed;
  163.   short    stage;            /* painting stage for blinking etc. */
  164. } field[h][w];
  165.  
  166. Bool        gamestop;
  167. Bool        scoreobs;            /* is score line obsolete ? */
  168. int        levelnum;            /* Current level number */
  169. int        lives;            /* Current number of lives */
  170. int        score;            /* Total score */
  171. int        speed;            /* Speed of game.  1 is slowest, 15 is
  172.                          * default */
  173.  
  174. struct sound    sndExplode;
  175. struct sound    sndWhizz;
  176. struct sound    sndOver;
  177. struct sound    sndYahoo;
  178.  
  179. #endif
  180.