2022-11-22 17:32:29 +01:00
|
|
|
#include<stdlib.h>
|
|
|
|
#include<graph.h>
|
2022-11-28 17:46:17 +01:00
|
|
|
#include<stdio.h>
|
2022-11-29 17:30:12 +01:00
|
|
|
#include "menu.h"
|
|
|
|
/*nombre de paire min = 4*/
|
2022-11-28 17:46:17 +01:00
|
|
|
|
2022-11-29 17:30:12 +01:00
|
|
|
int menu(void){
|
2022-11-28 17:46:17 +01:00
|
|
|
int xpos;
|
|
|
|
int ypos;
|
2022-12-01 16:42:34 +01:00
|
|
|
int i=10,j=3;
|
2022-11-28 17:46:17 +01:00
|
|
|
char choix[50];
|
2022-11-22 17:32:29 +01:00
|
|
|
InitialiserGraphique();
|
|
|
|
CreerFenetre(0,0,1024,576);
|
|
|
|
couleur c=CouleurParComposante(255,255,255);
|
|
|
|
ChoisirCouleurDessin(c);
|
|
|
|
ChargerImage("Images/background.png",0,0,0,0,1024,576);
|
2022-11-28 17:46:17 +01:00
|
|
|
ChargerImage("Images/Menu1.png",276,19,0,0,476,63);
|
2022-11-22 17:32:29 +01:00
|
|
|
c=CouleurParComposante(0,0,0);
|
|
|
|
ChoisirCouleurDessin(c);
|
2022-11-28 17:46:17 +01:00
|
|
|
ChargerImage("Images/Menu2.png",323,250,0,0,383,44);
|
|
|
|
ChargerImage("Images/Fleche1.png",290,253,0,0,33,39);
|
|
|
|
ChargerImage("Images/Fleche2.png",710,253,0,0,34,39);
|
|
|
|
ChargerImage("Images/Start.png",375,400,0,0,280,79);
|
|
|
|
c=CouleurParComposante(255,255,255);
|
|
|
|
ChoisirCouleurDessin(c);
|
2022-12-01 16:04:09 +01:00
|
|
|
RemplirRectangle(495,320,40,40);
|
2022-11-28 17:46:17 +01:00
|
|
|
while(1){
|
2022-11-30 22:19:45 +01:00
|
|
|
if(i!=j){
|
|
|
|
snprintf(choix,50,"%d",i);
|
|
|
|
c=CouleurParComposante(255,255,255);
|
|
|
|
ChoisirCouleurDessin(c);
|
2022-12-01 16:04:09 +01:00
|
|
|
RemplirRectangle(495,320,40,40);
|
2022-11-30 22:19:45 +01:00
|
|
|
c=CouleurParComposante(0,0,0);
|
|
|
|
ChoisirCouleurDessin(c);
|
|
|
|
EcrireTexte(500,350,choix,2);
|
|
|
|
}
|
|
|
|
j=i;
|
2022-11-28 17:46:17 +01:00
|
|
|
if(SourisCliquee()==1){
|
|
|
|
xpos=_X;
|
|
|
|
ypos=_Y;
|
2022-11-29 17:30:12 +01:00
|
|
|
if((xpos>=291 && xpos<=320) && (ypos>=256 && ypos<=287)){
|
|
|
|
i--;
|
2022-12-01 16:42:34 +01:00
|
|
|
if (i==0){
|
2022-11-29 17:30:12 +01:00
|
|
|
i=20;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if((xpos>=714 && xpos<=739) && (ypos>=256 && ypos<=287)){
|
|
|
|
i++;
|
|
|
|
if(i==21){
|
2022-12-01 16:42:34 +01:00
|
|
|
i=1;
|
2022-11-28 17:46:17 +01:00
|
|
|
}
|
2022-11-29 17:30:12 +01:00
|
|
|
}
|
|
|
|
if((xpos>=380 && xpos<=650) && (ypos>=402 && ypos<=473)){
|
|
|
|
return i;
|
2022-11-28 17:46:17 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-11-22 17:32:29 +01:00
|
|
|
}
|