From c739a98cecca17f59944d5811ffa0371ecccf14e Mon Sep 17 00:00:00 2001 From: proal Date: Thu, 24 Nov 2022 11:38:45 +0100 Subject: [PATCH] modification nom images et random tirage --- Images/{image00.png => image0.png} | Bin Images/{image01.png => image1.png} | Bin Images/{image02.png => image2.png} | Bin Images/{image03.png => image3.png} | Bin Images/{image04.png => image4.png} | Bin Images/{image05.png => image5.png} | Bin Images/{image06.png => image6.png} | Bin Images/{image07.png => image7.png} | Bin Images/{image08.png => image8.png} | Bin Images/{image09.png => image9.png} | Bin images.c | 77 +++++++++++++++-------------- 11 files changed, 39 insertions(+), 38 deletions(-) rename Images/{image00.png => image0.png} (100%) rename Images/{image01.png => image1.png} (100%) rename Images/{image02.png => image2.png} (100%) rename Images/{image03.png => image3.png} (100%) rename Images/{image04.png => image4.png} (100%) rename Images/{image05.png => image5.png} (100%) rename Images/{image06.png => image6.png} (100%) rename Images/{image07.png => image7.png} (100%) rename Images/{image08.png => image8.png} (100%) rename Images/{image09.png => image9.png} (100%) diff --git a/Images/image00.png b/Images/image0.png similarity index 100% rename from Images/image00.png rename to Images/image0.png diff --git a/Images/image01.png b/Images/image1.png similarity index 100% rename from Images/image01.png rename to Images/image1.png diff --git a/Images/image02.png b/Images/image2.png similarity index 100% rename from Images/image02.png rename to Images/image2.png diff --git a/Images/image03.png b/Images/image3.png similarity index 100% rename from Images/image03.png rename to Images/image3.png diff --git a/Images/image04.png b/Images/image4.png similarity index 100% rename from Images/image04.png rename to Images/image4.png diff --git a/Images/image05.png b/Images/image5.png similarity index 100% rename from Images/image05.png rename to Images/image5.png diff --git a/Images/image06.png b/Images/image6.png similarity index 100% rename from Images/image06.png rename to Images/image6.png diff --git a/Images/image07.png b/Images/image7.png similarity index 100% rename from Images/image07.png rename to Images/image7.png diff --git a/Images/image08.png b/Images/image8.png similarity index 100% rename from Images/image08.png rename to Images/image8.png diff --git a/Images/image09.png b/Images/image9.png similarity index 100% rename from Images/image09.png rename to Images/image9.png diff --git a/images.c b/images.c index bec8d4b..8f08f55 100644 --- a/images.c +++ b/images.c @@ -1,46 +1,47 @@ -#include -#include -#include +#include +#include +#include +#include #include "images.h" -void chargement(void){ +void main(void){ InitialiserGraphique(); ChoisirEcran(0); CreerFenetre(0,0,1024,576); - - ChargerImage("Images/background.png",0,0,0,0,1024,576); - ChargerImage("Images/image00.png",10,10,0,0,40,40); - ChargerImage("Images/image01.png",60,10,0,0,40,40); - ChargerImage("Images/image02.png",110,10,0,0,40,40); - ChargerImage("Images/image03.png",160,10,0,0,40,40); - ChargerImage("Images/image04.jpg",210,10,0,0,40,40); - ChargerImage("Images/image05.jpg",260,10,0,0,40,40); - ChargerImage("Images/image06.jpg",310,10,0,0,40,40); - ChargerImage("Images/image07.png",360,10,0,0,40,40); - ChargerImage("Images/image08.png",10,60,0,0,40,40); - ChargerImage("Images/image09.png",60,60,0,0,40,40); - ChargerImage("Images/image10.png",110,60,0,0,40,40); - ChargerImage("Images/image11.png",160,60,0,0,40,40); - ChargerImage("Images/image12.png",210,60,0,0,40,40); - ChargerImage("Images/image13.png",260,60,0,0,40,40); - ChargerImage("Images/image14.png",310,60,0,0,40,40); - ChargerImage("Images/image15.png",360,60,0,0,40,40); - ChargerImage("Images/image16.png",10,110,0,0,40,40); - ChargerImage("Images/image17.png",60,110,0,0,40,40); - ChargerImage("Images/image18.png",110,110,0,0,40,40); - ChargerImage("Images/image19.png",160,110,0,0,40,40); - ChargerImage("Images/image20.png",210,110,0,0,40,40); - ChargerImage("Images/image00.png",260,110,0,0,40,40); - ChargerImage("Images/image00.png",310,110,0,0,40,40); - ChargerImage("Images/image00.png",360,110,0,0,40,40); - ChargerImage("Images/image00.png",10,160,0,0,40,40); - ChargerImage("Images/image00.png",60,160,0,0,40,40); - ChargerImage("Images/image00.png",110,160,0,0,40,40); - ChargerImage("Images/image00.png",160,160,0,0,40,40); - ChargerImage("Images/image00.png",210,160,0,0,40,40); - ChargerImage("Images/image00.png",260,160,0,0,40,40); - ChargerImage("Images/image00.png",310,160,0,0,40,40); - ChargerImage("Images/image00.png",360,160,0,0,40,40); + int images_dispo[20]; + int nb_tire; + int boucle; + char tirage[50]; + int tire; + int pos_x; + int pos_y; + ChargerImage("Images/background.png",0,0,0,0,1024,576); + + /*Remplissage du tableau*/ + for(boucle=0;boucle<20;boucle++){ + images_dispo[boucle]=2; + } + + /*Tirage de la première image*/ + for (pos_y=10;pos_y<380;pos_y=pos_y+90){ + for (pos_x=10;pos_x<650;pos_x=pos_x+90){ + srand(time(NULL)); + nb_tire=rand()%20; + while (images_dispo[nb_tire]==0){ + printf("oui"); + srand(time(NULL)); + nb_tire=rand()%20; + } + images_dispo[nb_tire]--; + + tire=nb_tire+1; + snprintf(tirage,50,"Images/image%d.png",tire); + ChargerImage(tirage,pos_x,pos_y,0,0,80,80); + } + } + + Touche(); + FermerGraphique(); } \ No newline at end of file