thrive/01_text_adventure/main.c
2025-01-18 06:34:36 -05:00

48 lines
1.0 KiB
C

#include "game.h"
#include "../raylib.h"
#include "log.h"
#include "input.h"
#include "parse.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#define TARGET_FPS 60
int main(void) {
InitWindow(800, 450, "Text Adventure");
SetTargetFPS(TARGET_FPS);
Game *g = game_create();
game_load_rooms(g);
g->current_room = &g->rooms->rooms[0];
game_load_transitions(g);
game_load_words(g);
game_load_flags(g);
game_load_actions(g);
for (int i = 0; i < g->actions->count; i++) {
for (int j = 0; j < g->actions->actions[i].words_count; j++) {
printf("%s ", g->actions->actions[i].words[j]->word);
}
printf("|");
for (int j = 0; j < g->actions->actions[i].predicates_count; j++) {
if (j > 0) printf(" & ");
fflush(stdout);
print_predicate(g->actions->actions[i].predicates[j]);
}
printf("|%d|%s|effects", g->actions->actions[i].priority, g->actions->actions[i].description);
printf("\n");
}
game_run_until_close(g);
CloseWindow();
free_game(g);
return 0;
}