modification nom images et random tirage

This commit is contained in:
Mathieu PROAL 2022-11-24 11:38:45 +01:00
parent ac65a7872c
commit c739a98cec
11 changed files with 39 additions and 38 deletions

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -1,46 +1,47 @@
#include<stdio.h> #include <stdio.h>
#include<stdlib.h> #include <stdlib.h>
#include<graph.h> #include <graph.h>
#include <time.h>
#include "images.h" #include "images.h"
void chargement(void){ void main(void){
InitialiserGraphique(); InitialiserGraphique();
ChoisirEcran(0); ChoisirEcran(0);
CreerFenetre(0,0,1024,576); CreerFenetre(0,0,1024,576);
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); 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);
/*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();
} }