Spielinitialisierung in main.c und Makefile Target wordsalad_myversion hinzugefügt

This commit is contained in:
kleinleinta105608 committed 2026-10-26 00:49:47 +01:00
1 parent fbd986c66f
commit c3e875f493
2 files changed
+17 -1

No files matched your search

+10 -1
View File
@@ -6,6 +6,7 @@
#define MAX_NUMBER_OF_WORDS 100
#define SALAD_SIZE 20
#define WINDOW_WIDTH 800 //Breite Spielfenster 800 Pixel
int main(int argc, char *argv[])
{
@@ -36,10 +37,18 @@ int main(int argc, char *argv[])
// Create the word salad by placing words into grid
placedWords = createWordSalad(wordSalad, SALAD_SIZE, words, wordCount);
// TODO:
// TODO: erledigt
// Check if all words were successfully placed
// Start the game if successful
// error message if some words couldn't be placed
if (placedWords == wordCount) //wenn alle Wörter erfolgreicht plaziert sind
{
startGame(wordSalad, SALAD_SIZE, words, wordCount, WINDOW_WIDTH); //Startet das Spiel
}
else
{
printf("Fehler: Es konnten nicht alle Wörter plaziert werden\n"); //Gibt Fehlermeldung aus
}
}
else
+7
View File
@@ -22,6 +22,13 @@ codefolder = .
wordsalad_initial:
$(CC) -o wordsalad_initial -L. $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS)
# --------------------------
# meine Version
# --------------------------
wordsalad_myversion: main.o graphicalGame.o $(BINARIES)/libraylib.a
$(CC) $(CFLAGS) -o wordsalad_myversion main.o graphicalGame.o $(BINARIES)/libwordsalad.a $(BINARIES)/libraylib.a $(LDFLAGS)
# --------------------------
# Normales Spiel bauen
# --------------------------