/**********************************************************\ * Bugs : a bit-mapped arcade game for the AT&T UNIX PC. * * * * By : Hans Jespersen * * * * R.R.1 * * Terra Cotta, Ontario * * L0P 1N0 * * * \**********************************************************/ #include #include #include #include #include #include /* * Things you may want to modify */ /* place to put highscore file */ #define SCORE_FILE "/usr/games/lib/bugs.hs" /* controls (not including mouse) */ #define KILL 's' #define SHOOT 'a' #define BEEP 'b' #define LEFTKEY 'j' #define STOPKEY 'k' #define RIGHTKEY 'l' #define QUIT 'q' /* increaments */ #define DROPINC 12 #define MOVEINC 8 #define BASEINC 2 #define SHOTINC 8 #define UFOINC 2 /* chance of getting a UFO */ #define UFOCHANCE 3000 /* * Things you won't want to modify */ #define SCREEN_WIDTH 720 #define SCREEN_HEIGHT 300 #define BUG_WIDTH 32 #define BUG_HEIGHT 24 #define REAL_BUG_WIDTH 28 #define BUGSCORE 30 #define BASE_WIDTH 32 #define BASE_HEIGHT 16 #define REAL_BASE_WIDTH 28 #define BASE_LEVEL SCREEN_HEIGHT - BASE_HEIGHT #define SHELTER_WIDTH 48 #define SHELTER_HEIGHT 32 #define SHELTER_LEVEL 236 #define UFO_WIDTH 32 #define UFO_HEIGHT 24 #define SHOT_WIDTH 16 #define SHOT_HEIGHT 16 #define SHOT_OFFSET 12 #define REAL_SHOT_WIDTH 3 #define SHOTSCORE 10 #define BANG_WIDTH 32 #define BANG_HEIGHT 24 #define MAXBUGS 50 #define MAXSHOTS 10 #define MAXSHELTERS 4 #define MAXLEVEL 6 #define TRUE 1 #define FALSE 0 #define RIGHT 1 #define LEFT -1 #define STOP 0 extern unsigned short patwhite[]; extern unsigned short patgray[]; extern unsigned short patltgray[]; extern unsigned short patblack[]; unsigned short screen[SCREEN_WIDTH * SCREEN_HEIGHT / 16]; unsigned short bug[2][BUG_WIDTH * BUG_HEIGHT / 16]; unsigned short base[BASE_WIDTH * BASE_HEIGHT / 16]; unsigned short shelter[SHELTER_WIDTH * SHELTER_HEIGHT / 16]; unsigned short ufo[UFO_WIDTH * UFO_HEIGHT / 16]; unsigned short shot[SHOT_WIDTH * SHOT_HEIGHT / 16]; unsigned short bang[BANG_WIDTH * BANG_HEIGHT / 16]; struct position { int x; int y; }; struct position buglist[MAXBUGS]; struct position shelterlist[MAXSHELTERS]; struct position shotlist[MAXSHOTS]; struct position myshot; struct position mybase; struct position ufopos; int wn; int nbugs; int nshots; int shotflag; int bugflag; int dropflag; int beepflag; int quitflag; int shelterflag; int ufoflag; int score; int men; int bugnum; int shotnum; int bugdir; int chance; int level;