diff --git a/background/ecran-victoire.png b/background/ecran-victoire.png new file mode 100644 index 0000000..d2d8cbf Binary files /dev/null and b/background/ecran-victoire.png differ diff --git a/background/menu-difficultee.png b/background/menu-difficultee.png new file mode 100644 index 0000000..aec6f5e Binary files /dev/null and b/background/menu-difficultee.png differ diff --git a/background/menu-jouer.png b/background/menu-jouer.png new file mode 100644 index 0000000..25afba4 Binary files /dev/null and b/background/menu-jouer.png differ diff --git a/background/menu-quitter.png b/background/menu-quitter.png new file mode 100644 index 0000000..5a46848 Binary files /dev/null and b/background/menu-quitter.png differ diff --git a/background/menu-theme-retour.png b/background/menu-theme-retour.png new file mode 100644 index 0000000..21dc6ba Binary files /dev/null and b/background/menu-theme-retour.png differ diff --git a/background/menu-theme.png b/background/menu-theme.png new file mode 100644 index 0000000..ba68aff Binary files /dev/null and b/background/menu-theme.png differ diff --git a/background/menu.png b/background/menu.png new file mode 100644 index 0000000..878a01b Binary files /dev/null and b/background/menu.png differ diff --git a/menu_v1 b/menu_v1 new file mode 100755 index 0000000..a4d5b28 Binary files /dev/null and b/menu_v1 differ diff --git a/menu_v1.c b/menu_v1.c new file mode 100644 index 0000000..479abcd --- /dev/null +++ b/menu_v1.c @@ -0,0 +1,84 @@ +#include +#include +#include + +int menu_principal(void){ + int x; + int y; + EffacerEcran(CouleurParNom("grey")); + + ChoisirCouleurDessin(CouleurParNom("red")); + RemplirRectangle(180,580,100,25); + RemplirRectangle(720,580,100,25); + + ChoisirCouleurDessin(CouleurParNom("black")); + EcrireTexte(475,200,"Memorie",2); + EcrireTexte(200,600,"Quitter",1); + EcrireTexte(750,600,"jouer",1); + + ToucheEnAttente(); + while(1){ + if(SourisCliquee()){ + x=_X; + y=_Y; + + if((x>180) && (x<280) && (y>580) && (y<605)){ + break; + } + + if((x>720) && (x<820) && (y>580) && (y<605)){ + mode_jeu(); + } + } + } + FermerGraphique(); + return EXIT_SUCCESS; +} + +int mode_jeu(void){ + int x; + int y; + EffacerEcran(CouleurParNom("gray")); + ChoisirCouleurDessin(CouleurParNom("red")); + RemplirRectangle(450,300,100,25); + RemplirRectangle(400,400,200,380); + RemplirRectangle(700,400,200,380); + RemplirRectangle(100,400,200,380); + + ChoisirCouleurDessin(CouleurParNom("Black")); + RemplirRectangle(100,780,200,50); + RemplirRectangle(400,780,200,50); + RemplirRectangle(700,780,200,50); + EcrireTexte(400,200,"Mode de Jeu",2); + EcrireTexte(470,320,"retour",1); + + ChoisirCouleurDessin(CouleurParNom("white")); + EcrireTexte(140,810,"theme_1",2); + EcrireTexte(440,810,"theme_2",2); + EcrireTexte(740,810,"theme_3",2); + + + + ToucheEnAttente(); + while(1){ + if (SourisCliquee()){ + x=_X; + y=_Y; + if((x>450) && (x<550) && (y>300) && (y<325)){ + menu_principal(); + } + } + } + return EXIT_SUCCESS; +} + +int main(void){ + int x ; + int y ; + couleur c; + + InitialiserGraphique(); + CreerFenetre(10,10,1000,1000); + menu_principal(); + return EXIT_SUCCESS; +} diff --git a/menu_v2 b/menu_v2 new file mode 100755 index 0000000..daa3c25 Binary files /dev/null and b/menu_v2 differ diff --git a/menu_v2.c b/menu_v2.c new file mode 100644 index 0000000..17fd174 --- /dev/null +++ b/menu_v2.c @@ -0,0 +1,152 @@ +#include +#include +#include + +int menu_principal(void){ + //créeation de variable de position + int x; + int y; + + ToucheEnAttente(); + while(1){ + 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"); + } + + if (SourisCliquee()){ + x=_X; + y=_Y; + + //retour au menu principal + if((x>1194) && (x<1399) && (y>45) && (y<121)){ + menu_principal(); + } + + //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)){ + 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)){ + 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")); + } + } + } + } + } + } + } + } + } + FermerGraphique(); + return EXIT_SUCCESS; +} + + +int main(void){ + //création de la fenetre + InitialiserGraphique(); + CreerFenetre(10,10,1500,844); + + //ouverture du menu principal + menu_principal(); + + return EXIT_SUCCESS; +} diff --git a/souris_test b/souris_test new file mode 100755 index 0000000..370a149 Binary files /dev/null and b/souris_test differ diff --git a/souris_test.c b/souris_test.c new file mode 100644 index 0000000..2c15f73 --- /dev/null +++ b/souris_test.c @@ -0,0 +1,33 @@ +#include +#include + +#define tx 300 +#define ty 300 + +int main(void){ + char t[50]; + int x,y; + couleur c; + + InitialiserGraphique(); + CreerFenetre(100,100,tx,ty); + c=CouleurParNom("black"); + SourisPosition(); + x=_X; + y=_Y; + sprintf(t,"x=%3d:y=%3d",_X,_Y); + EffacerEcran(CouleurParNom("white")); + EcrireTexteC((tx-TailleChaineEcran(t,0))/2,ty/2,t,c,0); + + while(!SourisCliquee()){ + SourisPosition(); + if(_X!=x||_Y!=y){ + sprintf(t,"x=%3d:y=%3d",_X,_Y); + EffacerEcran(CouleurParNom("white")); + EcrireTexteC((tx-TailleChaineEcran(t,0))/2,ty/2,t,c,0); + x=_X; + y=_Y; + } + } + FermerGraphique(); +}