fin du menu
This commit is contained in:
parent
4e68face91
commit
6e4db04e66
BIN
background/ecran-victoire.png
Normal file
BIN
background/ecran-victoire.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 739 KiB |
BIN
background/menu-difficultee.png
Normal file
BIN
background/menu-difficultee.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 165 KiB |
83
menu_v2.c
83
menu_v2.c
@ -3,6 +3,7 @@
|
||||
#include <graph.h>
|
||||
|
||||
int menu_principal(void){
|
||||
//créeation de variable de position
|
||||
int x;
|
||||
int y;
|
||||
|
||||
@ -11,34 +12,48 @@ int menu_principal(void){
|
||||
SourisPosition();
|
||||
x=_X;
|
||||
y=_Y;
|
||||
|
||||
//affichage du menu principal sur le boutton jouer
|
||||
if((x>384) && (x<1114) && (y>384) && (y<460)){
|
||||
ChargerImageFond("./background/menu-jouer.png");
|
||||
}
|
||||
|
||||
//afficage du menu principal sur le boutton quitter
|
||||
else if((x>384) && (x<1114) && (y>497) && (y<573)){
|
||||
ChargerImageFond("./background/menu-quitter.png");
|
||||
}
|
||||
|
||||
//affichage du menu principal
|
||||
else{
|
||||
ChargerImageFond("./background/menu.png");
|
||||
}
|
||||
|
||||
|
||||
if(SourisCliquee()){
|
||||
x=_X;
|
||||
y=_Y;
|
||||
|
||||
//quitter
|
||||
if((x>384) && (x<1114) && (y>497) && (y<572)){
|
||||
break;
|
||||
}
|
||||
|
||||
//affichage du menu theme
|
||||
if((x>384) && (x<1114) && (y>384) && (y<459)){
|
||||
ChargerImageFond("./background/menu-theme.png");
|
||||
|
||||
ToucheEnAttente();
|
||||
while(1){
|
||||
SourisPosition();
|
||||
x=_X;
|
||||
y=_Y;
|
||||
|
||||
//affichage du menu sur le boutton retour
|
||||
if((x>1194) && (x<1399) && (y>45) && (y<121)){
|
||||
ChargerImageFond("./background/menu-theme-retour.png");
|
||||
}
|
||||
|
||||
//affichage du menu theme
|
||||
else{
|
||||
ChargerImageFond("./background/menu-theme.png");
|
||||
}
|
||||
@ -46,23 +61,73 @@ int menu_principal(void){
|
||||
if (SourisCliquee()){
|
||||
x=_X;
|
||||
y=_Y;
|
||||
|
||||
//retour au menu principal
|
||||
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){
|
||||
|
||||
//affichage du menu difficultée du theme n°1
|
||||
if((x>66) && (x<491) && (y>356) && (y<781)){
|
||||
ChargerImageFond("./background/menu-difficultee.png");
|
||||
|
||||
while(1){
|
||||
if(SourisCliquee()){
|
||||
x=_X;
|
||||
y=_Y;
|
||||
|
||||
if((x>68) && (x<488) && (y>266) && (y<696)){
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
}
|
||||
if((x>537) && (x<958) && (y>266) && (y<696)){
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
}
|
||||
if((x>1007) && (x<1432) && (y>266) && (y<696)) {
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//affichage du menu difficultée du theme n°2
|
||||
if((x>535) && (x<960) && (y>356) && (y<781)){
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
ChargerImageFond("./background/menu-difficultee.png");
|
||||
|
||||
while(1){
|
||||
if(SourisCliquee()){
|
||||
x=_X;
|
||||
y=_Y;
|
||||
if((x>68) && (x<488) && (y>266) && (y<696)){
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
}
|
||||
if((x>537) && (x<958) && (y>266) && (y<696)){
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
}
|
||||
if((x>1007) && (x<1432) && (y>266) && (y<696)) {
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//affichage du menu difficultée du theme 3
|
||||
if((x>1005) && (x<1430) && (y>356) &&(y<781)){
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
ChargerImageFond("./background/menu-difficultee.png");
|
||||
|
||||
while(1){
|
||||
if(SourisCliquee()){
|
||||
x=_X;
|
||||
y=_Y;
|
||||
if((x>68) && (x<488) && (y>266) && (y<696)){
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
}
|
||||
if((x>537) && (x<958) && (y>266) && (y<696)){
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
}
|
||||
if((x>1007) && (x<1432) && (y>266) && (y<696)) {
|
||||
EffacerEcran(CouleurParNom("grey"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -76,12 +141,12 @@ int menu_principal(void){
|
||||
|
||||
|
||||
int main(void){
|
||||
int x ;
|
||||
int y ;
|
||||
couleur c;
|
||||
|
||||
//création de la fenetre
|
||||
InitialiserGraphique();
|
||||
CreerFenetre(10,10,1500,844);
|
||||
|
||||
//ouverture du menu principal
|
||||
menu_principal();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user