aboutsummaryrefslogtreecommitdiff
path: root/src/menu.c
blob: 24c24c7ac961b8cdb06fdcc672330eb5638590b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdint.h>
#include <stdio.h>

#include "keyb.h"
#include "vga.h"
#include "text.h"
#include "data.h"
#include "game.h"

uint8_t run_menu()
{
    char b[10];

    blit_erase(0);

    sprintf(b, "HI %06li", get_hiscore());
    put_text(124, 10, b, 5);

    Rect dst = { 80, 45, 160, 38 };
    blit(binary_title_start, &dst);

    put_text(84, 110, "PRESS SPACE TO PLAY", 1);

    put_text(64, 140, "CODE, GRAPHICS AND SOUND", 2);
    put_text(96, 150, "JUAN J. MARTINEZ", 3);

    put_text(96, 180, "_2023 USEBOX.NET", 1);

    wait_vsync();
    blit_update();

    while (1)
    {
        if (keys[KEY_ESC])
            return 0;

        if (keys[KEY_SPACE])
            return 1;
    }
}