Travaux du dimanche 20 novembre
This commit is contained in:
parent
95c655d10e
commit
090f8eca5b
27
ChargerMainMenu.h
Normal file
27
ChargerMainMenu.h
Normal file
@ -0,0 +1,27 @@
|
||||
#include <stdlib.h>
|
||||
#include <graph.h>
|
||||
|
||||
void ChargerMainMenu() {
|
||||
couleur c;
|
||||
int apple;
|
||||
int mainMenu=1;
|
||||
c=CouleurParNom("white");
|
||||
ChoisirCouleurDessin(c);
|
||||
ChargerImageFond("./images/casinotable.png");
|
||||
EcrireTexte(587,60,"Match Pairs",2);
|
||||
DessinerRectangle(460,135,400,110);
|
||||
EcrireTexte(588,200,"Easy : 4x4",2);
|
||||
DessinerRectangle(460,315,400,110);
|
||||
EcrireTexte(583,380,"Medium : 5x4",2);
|
||||
DessinerRectangle(460,505,400,110);
|
||||
EcrireTexte(588,570,"Hard : 6x6",2);
|
||||
ChoisirCouleurDessin(CouleurParNom("red"));
|
||||
RemplirRectangle(1260,17,25,25);
|
||||
ChoisirCouleurDessin(CouleurParNom("white"));
|
||||
DessinerRectangle(1260,17,25,25);
|
||||
DessinerSegment(1260,17,1260+25,17+25);
|
||||
DessinerSegment(1260,17+25,1260+25,17);
|
||||
ChoisirEcran(1);
|
||||
EffacerEcran(CouleurParNom("orange"));
|
||||
ChoisirEcran(0);
|
||||
}
|
56
ChargerMode.h
Normal file
56
ChargerMode.h
Normal file
@ -0,0 +1,56 @@
|
||||
#include <stdlib.h>
|
||||
#include <graph.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
void AfficherGrille(int* tab,int nbcolonne, int nbligne) {
|
||||
int colonne;
|
||||
int ligne;
|
||||
int image;
|
||||
int taille=15;
|
||||
int i;
|
||||
int sprite;
|
||||
char str[50];
|
||||
srand(time(NULL));
|
||||
for (ligne=0;ligne<nbligne;ligne++) {
|
||||
for (colonne=0;colonne<nbcolonne;colonne++) {
|
||||
if (taille>=1) {
|
||||
image=rand() % taille;
|
||||
}
|
||||
else {
|
||||
image=0;
|
||||
}
|
||||
printf("%i\n",taille);
|
||||
sprintf(str,"./images/%i.png", tab[image]);
|
||||
for (i=image;i<taille;i++) {
|
||||
tab[i]=tab[i+1];
|
||||
}
|
||||
sprite=ChargerSprite(str);
|
||||
AfficherSprite(sprite,64*colonne,64*ligne);
|
||||
taille--;
|
||||
Touche();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ChargerModeFacile() {
|
||||
ChargerImageFond("./images/casinotable.png");
|
||||
int i;
|
||||
int f;
|
||||
int cpt=1;
|
||||
char str[50];
|
||||
int tab[16];
|
||||
for (i=0; i<16; i=i+2) {
|
||||
tab[i]=cpt;
|
||||
tab[i+1]=cpt;
|
||||
cpt+=1;
|
||||
}
|
||||
AfficherGrille(tab,4,4);
|
||||
}
|
||||
|
||||
void ChargerMode(int mode) {
|
||||
if (mode==1) {
|
||||
ChargerModeFacile();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user