wehfou/src/main.c

51 lines
928 B
C

#include "conf.h"
#include "lzy.h"
int main(int argc, const char **argv)
{
int x = 0;
int y = 0;
if (LZY_Init(argc, argv, "wehfou official goty", 30, "res/tset.png",
"res/font.png")) {
LZY_Log(LZY_GetError());
LZY_Quit();
return 1;
}
while (!LZY_ShouldQuit()) {
/* update */
LZY_CycleEvents();
if (LZY_KeyDown(LZYK_LEFT))
x -= 2;
if (LZY_KeyDown(LZYK_RIGHT))
x += 2;
if (LZY_KeyDown(LZYK_UP))
y -= 2;
if (LZY_KeyDown(LZYK_DOWN))
y += 2;
/* draw */
LZY_DrawBegin();
{
/* draw background */
LZY_DrawTileEx(0, 0, 0, 13, 7);
LZY_DrawTileEx(0, DISPLAY_WIDTH / 2, 0, 13, 7);
LZY_DrawTileEx(0, 0, DISPLAY_HEIGHT / 2, 13, 7);
LZY_DrawTileEx(0, DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2,
13, 7);
/* draw player */
if (LZY_DrawChar('s', x, y))
LZY_Log(LZY_GetError());
}
LZY_DrawEnd();
}
LZY_Log("cya");
LZY_Quit();
return 0;
}