44 lines
		
	
	
		
			855 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			855 B
		
	
	
	
		
			C
		
	
	
	
	
	
#include "game.h"
 | 
						|
#include "../raylib.h"
 | 
						|
#include "log.h"
 | 
						|
#include "input.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();
 | 
						|
 | 
						|
    Log *log = create_log();
 | 
						|
    Vector2 input_position = { 190, 200 };
 | 
						|
    Input *input = create_input(input_position);
 | 
						|
    input->log = log;
 | 
						|
    input->g = g;
 | 
						|
    input->command = '>'; // Don't change this
 | 
						|
    g->input = input;
 | 
						|
 | 
						|
    game_load_rooms(g);
 | 
						|
    g->current_room = &g->rooms.rooms[0];
 | 
						|
 | 
						|
    while (!WindowShouldClose() && !g->should_close)
 | 
						|
      {
 | 
						|
	BeginDrawing();
 | 
						|
	ClearBackground(BLACK);
 | 
						|
	handle_pressed_keys(input);
 | 
						|
	draw_log(log);
 | 
						|
	draw_text(input);
 | 
						|
        EndDrawing();
 | 
						|
    }
 | 
						|
    CloseWindow();
 | 
						|
    free_input(input);
 | 
						|
    free_log(log);
 | 
						|
 | 
						|
    return 0;
 | 
						|
}
 |