ajout : V2 du menu et fichier background associer

This commit is contained in:
Come Thuret 2022-12-01 21:39:34 +01:00
parent f0d20e1617
commit 4e68face91
7 changed files with 87 additions and 0 deletions

BIN
background/menu-jouer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

BIN
background/menu-quitter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

BIN
background/menu-theme.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

BIN
background/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

BIN
menu_v2 Executable file

Binary file not shown.

87
menu_v2.c Normal file
View File

@ -0,0 +1,87 @@
#include <stdlib.h>
#include <stdio.h>
#include <graph.h>
int menu_principal(void){
int x;
int y;
ToucheEnAttente();
while(1){
SourisPosition();
x=_X;
y=_Y;
if((x>384) && (x<1114) && (y>384) && (y<460)){
ChargerImageFond("./background/menu-jouer.png");
}
else if((x>384) && (x<1114) && (y>497) && (y<573)){
ChargerImageFond("./background/menu-quitter.png");
}
else{
ChargerImageFond("./background/menu.png");
}
if(SourisCliquee()){
x=_X;
y=_Y;
if((x>384) && (x<1114) && (y>497) && (y<572)){
break;
}
if((x>384) && (x<1114) && (y>384) && (y<459)){
ChargerImageFond("./background/menu-theme.png");
ToucheEnAttente();
while(1){
SourisPosition();
x=_X;
y=_Y;
if((x>1194) && (x<1399) && (y>45) && (y<121)){
ChargerImageFond("./background/menu-theme-retour.png");
}
else{
ChargerImageFond("./background/menu-theme.png");
}
if (SourisCliquee()){
x=_X;
y=_Y;
if((x>1194) && (x<1399) && (y>45) && (y<121)){
menu_principal();
}
if((x>66) && (x<491) && (y>356) && (y<781)){
EffacerEcran(CouleurParNom("grey"));
while(1){
}
}
if((x>535) && (x<960) && (y>356) && (y<781)){
EffacerEcran(CouleurParNom("grey"));
while(1){
}
}
if((x>1005) && (x<1430) && (y>356) &&(y<781)){
EffacerEcran(CouleurParNom("grey"));
while(1){
}
}
}
}
}
}
}
FermerGraphique();
return EXIT_SUCCESS;
}
int main(void){
int x ;
int y ;
couleur c;
InitialiserGraphique();
CreerFenetre(10,10,1500,844);
menu_principal();
return EXIT_SUCCESS;
}