home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / games / sot.zip / SOT.H < prev    next >
Text File  |  1988-10-24  |  3KB  |  92 lines

  1. /********** The Son of Tetris Project ************/
  2.  
  3. /* Include file for SOT project */
  4.  
  5. /************ DEFINES ***********/
  6.  
  7.  
  8. #define TRUE  1
  9. #define FALSE !TRUE
  10.  
  11. #define TABLE_LEN 5   /* no of entries in hi score table */
  12.  
  13. #define BLW 12       /* Width */
  14. #define BLH 22       /* Height */
  15. #define SCRW 80      /* Screen width */
  16.  
  17. #define NO_OF_KEY_PRESSES 5 /* Max no of key presses processed per iteration */
  18.  
  19. #define HORIZ_MOVE 1        /* Increments of horizontal movement */
  20. #define VERT_MOVE 1         /* Vertical movement */
  21.  
  22. /* Attributes */
  23.  
  24. #define CLEAR  0     /* = BLACK, illegal shape colour */
  25. #define BORDER 256
  26.  
  27.  
  28. /* Cursor Keys */
  29.  
  30. #define LEFT_KEY 203
  31. #define ROT_KEY 'r'
  32. #define RIGHT_KEY 205
  33. #define DROP_KEY  'd'
  34. #define LEVEL_KEY 'l'
  35.  
  36. #define ESC 27
  37.  
  38. /* Type definitions */
  39.  
  40. typedef enum{ test, insert, remve} sh_op_type; /* Operations permissible on shapes */
  41. typedef enum{ left, down, right, up, anti, clock} drctn_type; /* Directions to go */
  42.  
  43.  
  44. /************ TYPEDEFS ***********/
  45.  
  46. typedef struct
  47. {
  48.   int        ht;   /* ht/wd in orientation 0 */
  49.   int        wd;
  50.   int        col;
  51.   int       *map[4];
  52.   void      *next_shp;
  53. } SHP_TYPE;
  54.  
  55.  
  56. typedef struct
  57. {
  58.   int       o_x, o_y;   /* current position */
  59.   int       o_or;       /* current orientation */
  60.   SHP_TYPE *o_sh;       /* object shape */
  61.   int       o_temp;     /* object temperature */
  62. } OBJ_TYPE;
  63.  
  64. /************ DATA ***********/
  65.  
  66. extern int        arena[BLW][BLH];   /* Where everything is stored */
  67. extern SHP_TYPE  *shp_lst;           /* List of shape defns */
  68. extern int        no_of_shapes;      /* Total shape defns held */
  69.  
  70. /************ PROTOTYPES ***********/
  71.  
  72. void      champ_val(char *name, long *score_val, int rank);
  73. void      cursor_off(void);
  74. void      cursor_on(void);
  75. void      end_score(void);
  76. void      end_video(void);
  77. void      game(void);
  78. unsigned  get_another_go(long new_score);/* Dialogue between games */
  79. int       get_cursor_state(void);
  80. unsigned  get_level(void);        /* Get start level */
  81. void      init_arena(void);       /* Clear out arena and define borders */
  82. void      init_score(char *prog_name);
  83. void      init_shapes(void);
  84. void      init_video(void);
  85. unsigned  pause_game(void);       /* Pause window */
  86. void      p_arena(int left,int top,int right,int bottom);  /* video display */
  87. void      set_cursor_state(int state);
  88. void      update_score(unsigned level, long score, unsigned lines_del, SHP_TYPE *next_sh, int show_shape);
  89. void      update_score_table(char *name,long new_score);
  90. void      v_kill_row(int  t_row);
  91.  
  92.