diff --git a/Makefile b/Makefile index 35a987e..a269249 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,8 @@ OFILES = taille.o \ nbjoueur2.o \ boutonJVJ.o \ jeu.o \ + comportementJCJ.o \ + comportementJCIA.o \ main.o @@ -26,13 +28,17 @@ taille.o : taille.h jeu.h nbjoueur.o : nbjoueur.h +comportementJCJ.o : comportementJCJ.h + +comportementJCIA.o : comportementJCIA.h + boutonJVJ.o : boutonJVJ.h nbjoueur2.o : nbjoueur2.h grille.o : grille.h -jeu.o : jeu.h menu.h +jeu.o : jeu.h menu.h comportementJCJ.h comportementJCIA.h main.o : jeu.h diff --git a/comportementJCIA.c b/comportementJCIA.c new file mode 100644 index 0000000..5a54869 --- /dev/null +++ b/comportementJCIA.c @@ -0,0 +1,6 @@ +#include + + +void compJCIA(int taille){ + DessinerSegment(1, 1, 100, 100); +} diff --git a/comportementJCIA.h b/comportementJCIA.h new file mode 100644 index 0000000..8d47e13 --- /dev/null +++ b/comportementJCIA.h @@ -0,0 +1,8 @@ +#ifndef COMPORTEMENTJCIA_H +#define COMPORTEMENTJCIA_H + + +void compJCIA(int taille); + + +#endif diff --git a/comportementJCJ.c b/comportementJCJ.c new file mode 100644 index 0000000..6ba0f4c --- /dev/null +++ b/comportementJCJ.c @@ -0,0 +1,5 @@ +#include + +void compJCJ(int taille){ + DessinerSegment(0, 0, 100, 100); +} diff --git a/comportementJCJ.h b/comportementJCJ.h new file mode 100644 index 0000000..c96db1e --- /dev/null +++ b/comportementJCJ.h @@ -0,0 +1,8 @@ +#ifndef COMPORTEMENTJCJ_H +#define COMPORTEMENTJCJ_H + + +void compJCJ(int taille); + + +#endif diff --git a/grille.c b/grille.c index 634e9f0..0d18e7c 100644 --- a/grille.c +++ b/grille.c @@ -2,7 +2,7 @@ void Grille(int taille){ - int bord = 0, x = 100, xx = 0, y = 100, yy = 100; + int bord = 0, x = 100, xx = 50, y = 100, yy = 100; ChoisirCouleurDessin(CouleurParNom("Black")); for(bord = 0; bord < taille; bord++){ DessinerSegment(50, 100, x, 100); /* Dessine le bord du haut de la grille */ diff --git a/jeu.c b/jeu.c index ed55243..cf6a84b 100644 --- a/jeu.c +++ b/jeu.c @@ -1,16 +1,17 @@ #include - #include "menu.h" -/* 1 = JCJ 2 = JCIA*/ +#include "comportementJCJ.h" +#include "comportementJCIA.h" void Jeu(){ - int choix = 0; - choix = Menu(); - if(choix == 1){ - /**/ - }else if (choix == 2){ - /**/ + int choix[2], taille = 0; + Menu(choix); + taille = choix[1]; + if(choix[0] == 1){ + compJCJ(taille); + }else if (choix[0] == 2){ + compJCIA(taille); } while(1){} } diff --git a/menu.c b/menu.c index 7993775..b50f9d9 100644 --- a/menu.c +++ b/menu.c @@ -7,13 +7,12 @@ #include "grille.h" -int Menu() { +int Menu(int *retour) { int x = 50, y = 50, taille = -5, choix = 0, echotaille = 0, verrou = 0; /* initialisation des variable */ couleur c = CouleurParNom("white"); while(choix == 0){ /* Condition pour que le menu s'arrête quand le joueur aura selectionner le nombre de joueur */ ChoisirCouleurDessin(CouleurParNom("black")); EcrireTexte(x, y, "Taille de grille entre 3 et 9 :", 2); - taille = GererChoixTaille(); /* Récupération de la taille de la grille */ /* Demande a taille sa valeur pour la comparé pour savoir si menu peu passer a la selection de joueur */ if(taille > 2 && taille < 10){ @@ -35,7 +34,8 @@ int Menu() { } FermerGraphique(); InitialiserGraphique(); - CreerFenetre(50, 50, 650, 650); + CreerFenetre(50, 50, 650, 650); Grille(echotaille); /* Lancement du code qui affiche la grille */ - return choix; + retour[0] = choix; + retour[1] = echotaille; } diff --git a/menu.h b/menu.h index 94cd8c7..9c318d3 100644 --- a/menu.h +++ b/menu.h @@ -4,6 +4,6 @@ -int Menu(); +int Menu(int *retour); #endif diff --git a/taille.c b/taille.c index 452054b..18db5db 100644 --- a/taille.c +++ b/taille.c @@ -43,7 +43,7 @@ void AfficherSelectionBoutton(){ DessinerSegment(100, 200, 150, 200); DessinerSegment(100, 100, 100, 200); DessinerSegment(150, 100, 150, 200); - ChargerImage("3.png", 100, 100, 150, 200, 50, 100); + ChargerImage("3.xpm", 100, 100, 150, 200, 50, 100); DessinerSegment(200, 100, 250, 100); DessinerSegment(200, 200, 250, 200);