diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -1,8 +1,32 @@ #include "lzr.h" #include "cfg.h" +#include "level.h" +#include "commands.h" +#include <stdlib.h> + +static float rcol(void) +{ + return (rand() & 1) * 0.1; +} int main(int argc, char **argv) { (void)argc, (void)argv; - return 0; + if (LZR_Init(cfg)) + return LZR_Quit(), 1; + if (LZR_ImageLoad("res/left.bmp") < 0 || + LZR_ImageLoad("res/right.bmp") < 0 || + LZR_ImageLoad("res/up.bmp") < 0 || + LZR_ImageLoad("res/down.bmp") < 0) + return LZR_Quit(), 1; + while (!LZR_ShouldQuit()) { + LZR_CycleEvents(); + LZR_DrawBegin(); + LZR_DrawSetColor(rcol(), rcol(), rcol(), 1); + LZR_DrawClear(); + level_draw(); + commands_draw(); + LZR_DrawEnd(); + } + return LZR_Quit(), 0; } |