1 /***************************************************************************\ 2 |* *| 3 |* game.h: A version of Tetris to run on ordinary terminals, *| 4 |* (ie., not needing a workstation, so should available *| 5 |* to peasant Newwords+ users. This is the module that *| 6 |* actually plays the game, (ie. moves things down the *| 7 |* screen, select(2)s on the keyboard, and so on) *| 8 |* *| 9 |* Author: Mike Taylor (mirk@uk.co.ssl) *| 10 |* Started: Fri May 26 12:26:05 BST 1989 *| 11 |* *| 12 \***************************************************************************/ 13 14 #define LEFT_KEY ',' /* Move piece left */ 15 #define RIGHT_KEY '/' /* Move piece right */ 16 #define ROTATE_KEY '.' /* Rotate piece anticlockwise */ 17 #define DROP_KEY ' ' /* Drop piece to bottom of screen */ 18 #define SUSP_KEY 's' /* Suspend. I'm sorry if its confusing */ 19 #define QUIT_KEY 'q' /* Quit. I'm sorry if its confusing */ 20 #define CHEAT_KEY 'Z' /* Cheat (a bit) -- Might not help! */ 21 22 #define REFRESH_KEY '\014' /* Control-L; refreshes screen */ 23 /* This is hard-coded in. It can't */ 24 /* be changed by setting TTKEYS, since */ 25 /* the peasants couldn't handle all that */ 26 /* "setenv TTKEYS `echo | tr`" carp(anag) */ 27 28 #define NO_MOVES 4 /* Number of moves allowed per fall */ 29 30 /*-------------------------------------------------------------------------*/ 31 32 extern char left_key; /* Move piece left */ 33 extern char right_key; /* Move piece right */ 34 extern char rotate_key; /* Rotate piece anticlockwise */ 35 extern char drop_key; /* Drop piece to bottom of screen */ 36 extern char susp_key; /* Suspend. I'm sorry if its confusing */ 37 extern char quit_key; /* Quit. I'm sorry if its confusing */ 38 extern char cheat_key; /* Frogging identical comments :-P */ 39 40 extern char erase_as[3]; 41 42 /*-------------------------------------------------------------------------*/ 43 44 extern void clear_board (); 45 extern void play_game (); 46 47 /*-------------------------------------------------------------------------*/ 48