Puzzle noir et blanc utilisé pour le tutoriel gint.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

72 lines
1.0 KiB

#include <gint/display.h>
#include <gint/keyboard.h>
#include <gint/gint.h>
#include "game.h"
#include "engine.h"
static void draw_menu(int selected)
{
extern bopti_image_t img_title;
extern bopti_image_t img_levels;
dclear(C_WHITE);
dimage(0, 2, &img_title);
for(int i = 1; i <= 8; i++)
{
int x = 20 + 11*(i-1);
int y = 36;
if(i != 8)
{
dsubimage(x, y, &img_levels, 0,0,10,10, DIMAGE_NONE);
dprint(x+3, y+2, C_BLACK, "%d", i);
}
else
{
dsubimage(x, y, &img_levels, 11,0,10,10, DIMAGE_NONE);
}
if(i == selected)
{
drect(x+1, y+1, x+8, y+8, C_INVERT);
}
}
}
static int main_menu(void)
{
extern font_t font_mystere;
dfont(&font_mystere);
int selected = 1;
int key = 0;
while(key != KEY_EXE)
{
draw_menu(selected);
dupdate();
key = getkey().key;
if(key == KEY_LEFT && selected > 1)
selected--;
if(key == KEY_RIGHT && selected < 8)
selected++;
if(key == KEY_EXIT)
gint_osmenu();
}
return selected;
}
int main(void)
{
while(1)
{
GUNUSED int level = main_menu();
play_level(1);
}
}