SAE11_2023/SAE_semestre1/src/menu.c

25 lines
554 B
C
Raw Normal View History

#include <stdlib.h>
#include <stdio.h>
2023-12-21 12:29:12 +01:00
#include <graph.h>
#include "../fichier.h/menu.h"
2023-12-21 12:29:12 +01:00
int check_zone(zone z, int x, int y) {
return x >= z.x && x <= z.x + z.L && y >= z.y && y <= z.y + z.H;
}
2023-12-21 12:29:12 +01:00
void afficher_menu(zone jouer, zone quitter, int *choix) {
ChargerImageFond("../img/Menu.png");
while(1){
SourisPosition();
if(SourisCliquee()){
int x = _X;
int y = _Y;
if (check_zone(jouer, _X, _Y)){
*choix = 1;
return;
}
2023-12-21 12:29:12 +01:00
}
}
2023-12-21 12:29:12 +01:00
}