Affichage de la grille faite en fonction de la taille selectionner par le joueur
This commit is contained in:
6
Makefile
6
Makefile
@@ -25,7 +25,7 @@ CFLAGS = -Wall -ansi -pedantic
|
|||||||
|
|
||||||
#deplacement.o : pion.h obstacle.h
|
#deplacement.o : pion.h obstacle.h
|
||||||
|
|
||||||
menu.o : taille.h menu.h nbjoueur.h nbjoueur2.h boutonJVJ.h
|
menu.o : taille.h menu.h nbjoueur.h nbjoueur2.h boutonJVJ.h grille.h
|
||||||
|
|
||||||
#pion.o : deplacement.h obstacle.h
|
#pion.o : deplacement.h obstacle.h
|
||||||
|
|
||||||
@@ -37,11 +37,11 @@ boutonJVJ.o : boutonJVJ.h
|
|||||||
|
|
||||||
nbjoueur2.o : nbjoueur2.h
|
nbjoueur2.o : nbjoueur2.h
|
||||||
|
|
||||||
grille.o : grille.h taille.h
|
grille.o : grille.h
|
||||||
|
|
||||||
#obstacle.o : pion.h
|
#obstacle.o : pion.h
|
||||||
|
|
||||||
jeu.o : jeu.h
|
jeu.o : jeu.h grille.h
|
||||||
|
|
||||||
main.o : menu.h jeu.h
|
main.o : menu.h jeu.h
|
||||||
|
|
||||||
|
|||||||
34
grille.c
34
grille.c
@@ -1,10 +1,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <graph.h>
|
||||||
|
|
||||||
|
/*
|
||||||
#include "taille.h"
|
void Test(){
|
||||||
|
|
||||||
|
|
||||||
void Grille(int taillegrille){
|
|
||||||
int x, y;
|
int x, y;
|
||||||
int tabgrille[taillegrille + 2][taillegrille + 2];
|
int tabgrille[taillegrille + 2][taillegrille + 2];
|
||||||
for(x = 0; x < taillegrille + 2; x++){
|
for(x = 0; x < taillegrille + 2; x++){
|
||||||
@@ -21,3 +19,29 @@ void Grille(int taillegrille){
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
void Grille(int taille){
|
||||||
|
int bord = 0, x = 100, xx = 0, y = 100, yy = 100;
|
||||||
|
ChoisirCouleurDessin(CouleurParNom("Black"));
|
||||||
|
for(bord = 0; bord < taille; bord++){
|
||||||
|
DessinerSegment(50, 100, x, 100);
|
||||||
|
x += 50;
|
||||||
|
}
|
||||||
|
x -= 50;
|
||||||
|
for(bord = 0; bord <= taille; bord++){
|
||||||
|
DessinerSegment(50, 100, 50 , y);
|
||||||
|
DessinerSegment(x, 100, x, y);
|
||||||
|
y += 50;
|
||||||
|
}
|
||||||
|
y -= 50;
|
||||||
|
DessinerSegment(50, y, x, y);
|
||||||
|
for(bord = 0; bord <= taille; bord++){
|
||||||
|
DessinerSegment(50, yy, x, yy);
|
||||||
|
yy += 50;
|
||||||
|
}
|
||||||
|
for(bord = 0; bord <= taille; bord++){
|
||||||
|
DessinerSegment(xx, 100, xx, y);
|
||||||
|
xx += 50;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
2
grille.h
2
grille.h
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Grille(int taillegrille);
|
void Grille(int taille);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
4
jeu.c
4
jeu.c
@@ -6,10 +6,6 @@
|
|||||||
|
|
||||||
|
|
||||||
void GraphJeu(){
|
void GraphJeu(){
|
||||||
int x = 50, y = 50, xx = 150, yy = 50, i = 0;
|
|
||||||
printf("fichier jeu.c taille variable\n");
|
printf("fichier jeu.c taille variable\n");
|
||||||
for(i = 1; i < 9; i++){
|
|
||||||
DessinerSegment(x, y * i, xx * i, yy * i);
|
|
||||||
}
|
|
||||||
while(1){}
|
while(1){}
|
||||||
}
|
}
|
||||||
|
|||||||
6
menu.c
6
menu.c
@@ -5,7 +5,7 @@
|
|||||||
#include "nbjoueur.h"
|
#include "nbjoueur.h"
|
||||||
#include "nbjoueur2.h"
|
#include "nbjoueur2.h"
|
||||||
#include "boutonJVJ.h"
|
#include "boutonJVJ.h"
|
||||||
#include "jeu.h"
|
#include "grille.h"
|
||||||
|
|
||||||
|
|
||||||
int Menu() {
|
int Menu() {
|
||||||
@@ -40,7 +40,7 @@ int Menu() {
|
|||||||
printf("choix de menu %d\n", choix);
|
printf("choix de menu %d\n", choix);
|
||||||
FermerGraphique();
|
FermerGraphique();
|
||||||
InitialiserGraphique();
|
InitialiserGraphique();
|
||||||
/* Demander a Luck quel est la taille de fenetre max qu'il peut voir sur son écran pour corriger les SAE */
|
CreerFenetre(50, 50, 650, 650);
|
||||||
CreerFenetre(50, 50, 600, 600);
|
Grille(echotaille);
|
||||||
return choix;
|
return choix;
|
||||||
}
|
}
|
||||||
|
|||||||
3
taille.c
3
taille.c
@@ -2,8 +2,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
#include "grille.h"
|
|
||||||
|
|
||||||
|
|
||||||
/* Code permettant de choisir la taille de la grille en fonction du chiffre que l'utilisateur a entrer qui est compris entre 3 et 9 */
|
/* Code permettant de choisir la taille de la grille en fonction du chiffre que l'utilisateur a entrer qui est compris entre 3 et 9 */
|
||||||
|
|
||||||
@@ -34,7 +32,6 @@ int GererChoixTaille(){
|
|||||||
}
|
}
|
||||||
if(taille != 0){
|
if(taille != 0){
|
||||||
printf("Taille de taille.c = %d\n", taille);
|
printf("Taille de taille.c = %d\n", taille);
|
||||||
Grille(taille);
|
|
||||||
return taille;
|
return taille;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user