Ejemplo n.º 1
0
void exit_game()
{
    set_high_score();
    bullets.clear();
    printf("Thank You For Playing Galaxian !!\n\n\n");
    printf("This Game was made by :\n1. Ashish Kedia (12IT14)\n2. Ajith P S (12IT04)\n3. Adarsh Mohata (12IT03)\nNational Institute of Technology Karnataka, Surathkal");
    printf("\n\nYour Score : %lld\nHigh Score : %lld\n\n",curr_score,high_score);
    exit(0);
}
Ejemplo n.º 2
0
void init_high_scores( void ) 
{
    FILE *score_stream;
    char score_file[BUFF_LEN];
    score_info_t this_score;

    score_table = create_hash_table();
    if ( get_high_score_file_name( score_file, sizeof(score_file) ) == 0 ) {
	score_stream = fopen( score_file, "r" );
	if (score_stream != NULL) {
	    while (fread( &this_score, sizeof(this_score), 1, score_stream)) {
		set_high_score( this_score.event.event, this_score.event.cup,
				this_score.player_name, this_score.score );
	    }
	    if ( fclose( score_stream ) != 0 ) {
		perror( "fclose" );
	    }
	}
    }
}