ajoute image plus menu simple
This commit is contained in:
@@ -7,9 +7,48 @@
|
||||
|
||||
int main(void){
|
||||
int grille[NB_LIGNES][NB_COLS], touche;
|
||||
|
||||
init_affichage();
|
||||
char *nom_image = NULL;
|
||||
int choix_fait = 0;
|
||||
|
||||
init_affichage();
|
||||
|
||||
EffacerEcran(CouleurParNom("white"));
|
||||
ChoisirCouleurDessin(CouleurParNom("black"));
|
||||
|
||||
EcrireTexte(50, 50, "MENU TAQUIN", 2);
|
||||
EcrireTexte(50, 100, "Choisissez votre image :", 1);
|
||||
EcrireTexte(50, 150, "Touche 1 : Image 1", 1);
|
||||
EcrireTexte(50, 180, "Touche 2 : Image 2", 1);
|
||||
EcrireTexte(50, 210, "Touche 3 : Image 3", 1);
|
||||
EcrireTexte(50, 300, "(Appuyez sur q pour quitter)", 1);
|
||||
|
||||
while(choix_fait == 0) {
|
||||
if(ToucheEnAttente()) {
|
||||
touche = Touche();
|
||||
|
||||
printf("Touche reçue : %d (Caractère : %c)\n", touche, (char)touche);
|
||||
|
||||
if(touche == '1' || touche == 38) {
|
||||
nom_image = "image1.png";
|
||||
choix_fait = 1;
|
||||
}
|
||||
else if(touche == '2' || touche == 233) {
|
||||
nom_image = "image2.png";
|
||||
choix_fait = 2;
|
||||
}
|
||||
else if(touche == '3' || touche == 34) {
|
||||
nom_image = "image3.png";
|
||||
choix_fait = 3;
|
||||
}
|
||||
else if(touche == 'q' || touche == 27) {
|
||||
fermer_affichage();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
charger_image_source(nom_image);
|
||||
|
||||
initialiser_plateau(grille);
|
||||
|
||||
melanger_plateau(grille);
|
||||
|
||||
Reference in New Issue
Block a user