1 #include "badge_main_loop.h"
3 #include "jumpnrun/jumpnrun.h"
4 #include "ui/display.h"
14 #define MAX_LEVELS 1024
16 #define PATH_PREFIX "../badge/jumpnrun/levels/"
18 void badge_main_loop(void) {
19 char menu_buf
[MAX_LEVELS
][32];
20 FILE *fd
= fopen("levels.txt", "r");
24 for(i
= 0; i
< MAX_LEVELS
&& fgets(menu_buf
[i
], sizeof(menu_buf
[i
]), fd
); ++i
) {
25 menu_buf
[i
][strlen(menu_buf
[i
]) - 1] = '\0';
31 for(int j
= 0; j
< i
; ++j
) {
32 menu
[j
] = menu_buf
[j
];
36 uint8_t first_visible
= 0;
39 choice
= badge_menu(menu
, ARRAY_SIZE(menu
), &first_visible
, choice
);
41 sprintf(lvname
, PATH_PREFIX
"%s.lvl", menu
[choice
]);
43 jumpnrun_play_level(lvname
);
This page took 0.058251 seconds and 5 git commands to generate.