1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#include <stdio.h>
#include <raylib.h>
#include "scenes/scenes.h"
#include "resources/resources.h"
int main(void) {
Puzzle *puzzle = ReadPuzzleFromFile("puzzles/test.pz");
// printf("Puzzle name: %s\n", puzzle->Name);
// printf("Puzzle description: %s\n", puzzle->Description);
// printf("Puzzle code: %s\n", puzzle->InitialCode);
// printf("Puzzle TestC: %zu\n", puzzle->TestC);
// for (int i = 0; i < puzzle->TestC; i++) {
// Test t = puzzle->Tests[i];
// printf("\n");
// printf("\tTest rec: %s\n", t.RecieverName);
// printf("\tTest sig: %s\n", t.MainMethodSignature);
// printf("\tTest argc: %zu\n", t.argc);
// }
if (!ReadConfig(DEFAULT_CONFIG_LOCATION)) {
return 1;
}
if (!InitSceneStack()) {
printf("Failed to create a scene stack\n");
return 1;
}
if (!AddScene(CreateMainMenu())) {
printf("Failed to create a main menu\n");
return 1;
}
if (!AddScene(CreatePuzzleScene(puzzle))) {
printf("Failed to create a puzzle menu\n");
return 1;
}
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
InitWindow(800, 600, "Programming game");
LoadResources();
SetExitKey(KEY_NULL);
SetTargetFPS(60);
while (!WindowShouldClose()) {
UpdateScene();
BeginDrawing();
DrawScene();
DrawFPS(0, 0);
#ifdef BUILD_VERSION
DrawText(BUILD_VERSION, 0, GetScreenHeight() - 20, 20, COLORSCHEME_BROWN);
#endif // BUILD_VERSION
EndDrawing();
}
CloseWindow();
return 0;
}
|