| 
									
										
										
										
											2025-01-02 20:57:00 -05:00
										 |  |  | #include "game.h"
 | 
					
						
							| 
									
										
										
										
											2024-08-28 17:27:35 -04:00
										 |  |  | #include "../raylib.h"
 | 
					
						
							| 
									
										
										
										
											2024-08-30 06:27:14 -04:00
										 |  |  | #include "log.h"
 | 
					
						
							| 
									
										
										
										
											2024-08-28 17:27:35 -04:00
										 |  |  | #include "input.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <stdlib.h>
 | 
					
						
							| 
									
										
										
										
											2025-01-04 04:45:44 -05:00
										 |  |  | #include <stdio.h>
 | 
					
						
							| 
									
										
										
										
											2025-01-02 20:57:00 -05:00
										 |  |  | #include <stdbool.h>
 | 
					
						
							| 
									
										
										
										
											2024-08-28 17:27:35 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define TARGET_FPS 60
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-03 20:59:10 -05:00
										 |  |  | int main(void) { | 
					
						
							| 
									
										
										
										
											2024-08-28 17:27:35 -04:00
										 |  |  |     InitWindow(800, 450, "Text Adventure"); | 
					
						
							|  |  |  |     SetTargetFPS(TARGET_FPS); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-04 04:45:44 -05:00
										 |  |  |     Game *g = game_create(); | 
					
						
							| 
									
										
										
										
											2025-01-02 20:57:00 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-30 06:27:14 -04:00
										 |  |  |     Log *log = create_log(); | 
					
						
							|  |  |  |     Vector2 input_position = { 190, 200 }; | 
					
						
							|  |  |  |     Input *input = create_input(input_position); | 
					
						
							|  |  |  |     input->log = log; | 
					
						
							| 
									
										
										
										
											2025-01-04 04:45:44 -05:00
										 |  |  |     input->g = g; | 
					
						
							| 
									
										
										
										
											2025-01-03 21:24:56 -05:00
										 |  |  |     input->command = '>'; // Don't change this
 | 
					
						
							| 
									
										
										
										
											2025-01-04 04:45:44 -05:00
										 |  |  |     g->input = input; | 
					
						
							| 
									
										
										
										
											2024-08-28 17:27:35 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-04 04:45:44 -05:00
										 |  |  |     game_load_rooms(g); | 
					
						
							|  |  |  |     g->current_room = &g->rooms.rooms[0]; | 
					
						
							| 
									
										
										
										
											2025-01-03 21:24:56 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-04 04:45:44 -05:00
										 |  |  |     while (!WindowShouldClose() && !g->should_close) | 
					
						
							| 
									
										
										
										
											2024-08-28 17:27:35 -04:00
										 |  |  |       { | 
					
						
							|  |  |  | 	BeginDrawing(); | 
					
						
							|  |  |  | 	ClearBackground(BLACK); | 
					
						
							|  |  |  | 	handle_pressed_keys(input); | 
					
						
							| 
									
										
										
										
											2024-08-30 06:27:14 -04:00
										 |  |  | 	draw_log(log); | 
					
						
							|  |  |  | 	draw_text(input); | 
					
						
							| 
									
										
										
										
											2024-08-28 17:27:35 -04:00
										 |  |  |         EndDrawing(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     CloseWindow(); | 
					
						
							| 
									
										
										
										
											2025-01-02 20:57:00 -05:00
										 |  |  |     free_input(input); | 
					
						
							|  |  |  |     free_log(log); | 
					
						
							| 
									
										
										
										
											2024-08-28 17:27:35 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return 0; | 
					
						
							|  |  |  | } |