/**********************************************************\ * Rocks : a bit-mapped arcade game for the AT&T UNIX PC. * * * * By : Hans Jespersen * * * \**********************************************************/ #include "rocks.h" unsigned short rockwidth[3] = { SMALL_ROCK_WIDTH, MEDIUM_ROCK_WIDTH, LARGE_ROCK_WIDTH } ; unsigned short rockheight[3] = { SMALL_ROCK_HEIGHT, MEDIUM_ROCK_HEIGHT, LARGE_ROCK_HEIGHT } ; main(argc,argv) int argc; char *argv[]; { char c; int startlevel; if( argc > 2 ) { fprintf(stderr,"\nusage: %s [level]\n", argv[0]); fprintf(stderr," valid levels are 1..9\n"); fprintf(stderr," default level is %d\n",FIRSTLEVEL); exit(-1); } else if( argc == 2 ){ startlevel = argv[1][0] - '0'; if( (startlevel < 1) || (startlevel > 9) || (strlen(argv[1]) > 1) ){ fprintf(stderr,"\nusage: %s [level]\n", argv[0]); fprintf(stderr," valid levels are 1..9\n"); fprintf(stderr," default level is %d\n",FIRSTLEVEL); exit(-1); } } else startlevel = FIRSTLEVEL; defsprites(); /* Define the little critters */ wininit(); /* Set up the full screen window */ while( c != QUIT ){ score = 0; printscore(); level = startlevel; for(men = 2; men >= 0;) { initscreen( level ); /* Display initial screen */ playgame(); level++; } mvaddstr(5,35,"Hi Scores"); CheckHiScore( score ); DisplayHiScores(); wgoto( wn, 23, 21); printf( "Hit <%c> to quit, to continue." ,QUIT ); flushinp(); c = '\0'; while ( (c != QUIT) && (c != ' ') ) c = getchar(); } cleanup(); }