|
@ -22,6 +22,7 @@ void show_letters(char secret_word[100], char guessed_letters[100]); |
|
|
int letter_in_secret_word(char guessed_letter, char secret_word[100]); |
|
|
int letter_in_secret_word(char guessed_letter, char secret_word[100]); |
|
|
int has_won(char secret_word[100], char guessed_letters[100]); |
|
|
int has_won(char secret_word[100], char guessed_letters[100]); |
|
|
void level_plus(); |
|
|
void level_plus(); |
|
|
|
|
|
int overlay(); |
|
|
|
|
|
|
|
|
void protokoll(){ |
|
|
void protokoll(){ |
|
|
clear_screen(); |
|
|
clear_screen(); |
|
@ -39,7 +40,7 @@ void clear_screen() { |
|
|
void willkommen(){ |
|
|
void willkommen(){ |
|
|
char ENTERtxt[] = {"-Druecke ENTER zum starten-\n"}; |
|
|
char ENTERtxt[] = {"-Druecke ENTER zum starten-\n"}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
overlay(); |
|
|
printf("%s", ENTERtxt); |
|
|
printf("%s", ENTERtxt); |
|
|
getchar(); |
|
|
getchar(); |
|
|
} |
|
|
} |
|
@ -81,7 +82,7 @@ void nameWaehlen(){ |
|
|
fp = fopen("hangman.txt", "w"); |
|
|
fp = fopen("hangman.txt", "w"); |
|
|
|
|
|
|
|
|
clear_screen(); // |
|
|
clear_screen(); // |
|
|
|
|
|
|
|
|
|
|
|
overlay(); |
|
|
printf("Geben Sie den Namen ein: "); |
|
|
printf("Geben Sie den Namen ein: "); |
|
|
scanf("%s", name); |
|
|
scanf("%s", name); |
|
|
|
|
|
|
|
@ -97,7 +98,7 @@ void startauswahl() { |
|
|
int modus; |
|
|
int modus; |
|
|
|
|
|
|
|
|
clear_screen(); // |
|
|
clear_screen(); // |
|
|
|
|
|
|
|
|
|
|
|
overlay(); |
|
|
printf("Willkommen "); |
|
|
printf("Willkommen "); |
|
|
nameAusgeben(); |
|
|
nameAusgeben(); |
|
|
printf("[1] Spielen\n[2] Namen aendern\n"); |
|
|
printf("[1] Spielen\n[2] Namen aendern\n"); |
|
@ -150,7 +151,7 @@ void levelauswahl(){ |
|
|
int i = 0; |
|
|
int i = 0; |
|
|
|
|
|
|
|
|
clear_screen(); // |
|
|
clear_screen(); // |
|
|
|
|
|
|
|
|
|
|
|
overlay(); |
|
|
|
|
|
|
|
|
FILE *fp = NULL; |
|
|
FILE *fp = NULL; |
|
|
fp = fopen("hangman.txt", "r"); |
|
|
fp = fopen("hangman.txt", "r"); |
|
@ -163,7 +164,7 @@ void levelauswahl(){ |
|
|
levelstr[1] = KonfDatei[i-1]; |
|
|
levelstr[1] = KonfDatei[i-1]; |
|
|
levelstr[2] = '\0'; |
|
|
levelstr[2] = '\0'; |
|
|
level = atoi(levelstr); |
|
|
level = atoi(levelstr); |
|
|
//hauptspiel mit dem Level starten |
|
|
|
|
|
|
|
|
hauptSpiel(level); |
|
|
fclose(fp); |
|
|
fclose(fp); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -374,3 +375,24 @@ void level_plus(){ |
|
|
fprintf(fp, "%s", KonfDatei); |
|
|
fprintf(fp, "%s", KonfDatei); |
|
|
fclose(fp); |
|
|
fclose(fp); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int overlay(){ |
|
|
|
|
|
char hangmanArt[10][41] = { |
|
|
|
|
|
" _______ ", |
|
|
|
|
|
" | | ", |
|
|
|
|
|
" | ", |
|
|
|
|
|
" | ", |
|
|
|
|
|
" | ", |
|
|
|
|
|
" | ", |
|
|
|
|
|
"__|_________\n" |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
printf("Galgenmann!\n"); |
|
|
|
|
|
printf("v.1.0.2\n\n"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 9; i++) { |
|
|
|
|
|
printf("%s\n", hangmanArt[i]); |
|
|
|
|
|
} |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |