wehfou/src/main.c

44 lines
678 B
C
Raw Normal View History

2022-04-01 23:00:13 +02:00
#include "background.h"
2022-04-01 17:37:59 +02:00
#include "conf.h"
2022-04-01 18:31:34 +02:00
#include "input.h"
#include "level.h"
2022-04-01 17:37:59 +02:00
#include "lzy.h"
2022-04-01 18:31:34 +02:00
#include "player.h"
2022-04-01 17:37:59 +02:00
2022-04-01 18:31:34 +02:00
static void deinit(void);
2022-04-01 17:37:59 +02:00
2022-04-01 18:31:34 +02:00
int main(int argc, char **argv)
{
if (LZY_Init(argc, (const char **)argv, "wehfou official goty", 30,
"res/tset.png", "res/font.png")) {
2022-04-01 17:37:59 +02:00
LZY_Log(LZY_GetError());
2022-04-01 18:31:34 +02:00
deinit();
2022-04-01 17:37:59 +02:00
return 1;
}
2022-04-01 18:31:34 +02:00
level_load(0);
2022-04-01 23:00:13 +02:00
background_init();
2022-04-01 18:31:34 +02:00
2022-04-01 17:37:59 +02:00
while (!LZY_ShouldQuit()) {
LZY_CycleEvents();
2022-04-01 18:31:34 +02:00
input_update();
2022-04-01 23:00:13 +02:00
background_update();
2022-04-01 18:31:34 +02:00
player_update();
2022-04-01 17:37:59 +02:00
LZY_DrawBegin();
2022-04-01 23:00:13 +02:00
background_draw();
2022-04-01 18:41:25 +02:00
level_draw();
2022-04-01 18:31:34 +02:00
player_draw();
2022-04-01 17:37:59 +02:00
LZY_DrawEnd();
}
2022-04-01 18:31:34 +02:00
deinit();
2022-04-01 17:37:59 +02:00
return 0;
}
2022-04-01 18:31:34 +02:00
static void deinit(void)
{
level_deinit();
LZY_Quit();
}