From 03ff8e655aa1921b83ba4f1858b96079d01be5db Mon Sep 17 00:00:00 2001 From: Tiewa Taffo Christian Saurel Date: Tue, 20 Oct 2026 10:47:50 +0200 Subject: [PATCH] Implement game initialization in main.c and add Wordsalad_myversion target --- Startcode/main.c | 8 ++++++++ Startcode/makefile | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/Startcode/main.c b/Startcode/main.c index 03da755..20afed5 100644 --- a/Startcode/main.c +++ b/Startcode/main.c @@ -40,6 +40,14 @@ int main(int argc, char *argv[]) // Check if all words were successfully placed // Start the game if successful // error message if some words couldn't be placed + if(placedWords == wordCount){ + startGame(wordSalad, SALAD_SIZE, words, wordCount, 800); + } + else{ + fprintf(stderr, "Error: Could not place all worlds into the world salad (%u of %u placed).\n", placedWords, wordCount); + + exitCode = EXIT_FAILURE; + } } else diff --git a/Startcode/makefile b/Startcode/makefile index 7cf1d4c..00e2150 100644 --- a/Startcode/makefile +++ b/Startcode/makefile @@ -23,6 +23,17 @@ wordsalad_initial: $(CC) -o wordsalad_initial -L. $(BINARIES)/libwordsalad_complete.a $(BINARIES)/libraylib.a $(LDFLAGS) # -------------------------- +#--------------------------- +# My version +#----------------------- +#wordsalad_myversion: main.o +# $(CC) $(CFLAGS) -o wordsalad_myversion main.o -L. $(BINARIES)/libwordsalad.a $(BINARIES)/libraylib.a $(LDFLAGS) + +#----------------------------- +#Building myversion +#------------------------ +wordsalad_myversion: main.o graphicalGame.o + $(CC) $(CFLAGS) -o wordsalad_myversion main.o graphicalGame.o -L. $(BINARIES)/libwordsalad.a $(BINARIES)/libraylib.a $(LDFLAGS) # Normales Spiel bauen # -------------------------- wordsalad: main.o input.o game.o graphicalGame.o $(BINARIES)/libraylib.a