lubiXOXO
[hackover2013-badge-firmware.git] / mock / badge_main_loop.c
1 #include "badge_main_loop.h"
2
3 #include "jumpnrun/jumpnrun.h"
4 #include "ui/display.h"
5 #include "ui/event.h"
6 #include "ui/sprite.h"
7
8 #include <stdint.h>
9 #include <stdio.h>
10 #include <string.h>
11 #include <unistd.h>
12
13 void badge_main_loop(void) {
14
15 for(;;) {
16 FILE *fd = fopen("../badge/jumpnrun/levels.txt", "r");
17 char buf[12];
18
19 while(fgets(buf, sizeof(buf), fd)) {
20 buf[strlen(buf) - 1] = '\0';
21 char lvname[256];
22 sprintf(lvname, "../badge/jumpnrun/%s.lvl", buf);
23 while(jumpnrun_play(lvname) != JUMPNRUN_WON)
24 ;
25 }
26
27 fclose(fd);
28 }
29 }
This page took 0.041875 seconds and 5 git commands to generate.