hyperultra/src/main.c

38 lines
643 B
C
Raw Normal View History

2023-03-17 09:50:44 +01:00
#include "lzy.h"
2023-03-17 10:51:17 +01:00
#include "game.h"
#include "player.h"
#include <stdio.h>
#include <stdlib.h>
2023-03-17 09:50:44 +01:00
int main(void)
{
2023-03-17 10:20:30 +01:00
if (LZY_Init("Hyperultra!", 30, "res/tset.png", "res/font.png")) {
LZY_Log("LZY_Init failed: %s", LZY_GetError());
LZY_Quit();
return 1;
}
2023-03-17 10:51:17 +01:00
Game *const game = malloc(sizeof(Game));
if (game == NULL) {
LZY_Log("malloc failed");
LZY_Quit();
return 1;
}
game_init(game);
player_init(game_create_entity(game));
2023-03-17 10:20:30 +01:00
while (!LZY_ShouldQuit()) {
LZY_CycleEvents();
LZY_DrawBegin();
LZY_DrawSetColor(255, 255, 255);
LZY_DrawClear();
LZY_DrawEnd();
}
2023-03-17 10:51:17 +01:00
game_deinit(game);
free(game);
2023-03-17 10:20:30 +01:00
LZY_Quit();
return 0;
2023-03-17 09:50:44 +01:00
}