title screen and instructions

This commit is contained in:
kdx 2023-03-23 21:19:59 +01:00
parent fdaf9a4077
commit 65a36b0fc4
3 changed files with 42 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -473,7 +473,7 @@ static const SDL_Scancode sc[LZYK_COUNT * 2] = {
SDL_SCANCODE_RIGHT, SDL_SCANCODE_D,
SDL_SCANCODE_UP, SDL_SCANCODE_W,
SDL_SCANCODE_DOWN, SDL_SCANCODE_S,
SDL_SCANCODE_Z, SDL_SCANCODE_J,
SDL_SCANCODE_LSHIFT,SDL_SCANCODE_J,
SDL_SCANCODE_X, SDL_SCANCODE_K,
};
static const SDL_Scancode fullscreen_sc = SDL_SCANCODE_F11;

View File

@ -23,6 +23,47 @@ int main(void)
}
game_init(game);
int hold = 0;
int stage = 0;
while (!LZY_ShouldQuit()) {
LZY_CycleEvents();
input_update();
if (input_down(K_O))
hold += 1;
else
hold -= 3;
if (hold < 0)
hold = 0;
if (hold > 50) {
if (stage == 1)
break;
stage += 1;
hold = 0;
}
LZY_DrawBegin();
LZY_DrawSetColor(WHITE);
LZY_DrawClear();
LZY_DrawSetColor(BLACK);
int y = -16;
if (stage == 1) {
LZY_DrawText(48, y += 32, "WALKING is AUTOMATIC");
LZY_DrawText(48, y += 32, "press SHIFT to jump");
LZY_DrawText(48, y += 32, "hold UP to jump HIGHER");
LZY_DrawText(48, y += 32, "hold DOWN to jump LOWER");
}
else {
LZY_DrawText(48, y += 32, "HYPERULTRA");
LZY_DrawText(48, y += 32, "a game made by KDX.re");
LZY_DrawText(48, y += 32, "powered by GINT and SDL");
y += 32;
}
LZY_DrawText(48, y += 48, "hold SHIFT to continue");
if (hold)
LZY_DrawFillRect(0, DISPLAY_HEIGHT - 24, hold * 8, 24);
LZY_DrawEnd();
}
while (!LZY_ShouldQuit()) {
LZY_CycleEvents();
input_update();