netoyage de fichier
This commit is contained in:
27
Makefile
27
Makefile
@@ -7,16 +7,11 @@ but : game
|
|||||||
OFILES = taille.o \
|
OFILES = taille.o \
|
||||||
menu.o \
|
menu.o \
|
||||||
nbjoueur.o \
|
nbjoueur.o \
|
||||||
nbjoueur2.o \
|
|
||||||
boutonJVJ.o \
|
|
||||||
jeu.o \
|
|
||||||
comportementJCJ.o \
|
comportementJCJ.o \
|
||||||
comportementJCIA.o \
|
comportementJCIA.o \
|
||||||
definirMaxXY.o \
|
definirMaxXY.o \
|
||||||
initialisation.o \
|
initialisation.o \
|
||||||
coordoner.o \
|
coordoner.o \
|
||||||
effacehaut.o \
|
|
||||||
verificationblock.o \
|
|
||||||
main.o
|
main.o
|
||||||
|
|
||||||
|
|
||||||
@@ -26,31 +21,21 @@ CFLAGS = -Wall -ansi -pedantic
|
|||||||
|
|
||||||
# CHAPITRE 3 : DEPENDANCES (REGLES IMPLICITES)
|
# CHAPITRE 3 : DEPENDANCES (REGLES IMPLICITES)
|
||||||
|
|
||||||
menu.o : taille.h menu.h nbjoueur.h nbjoueur2.h boutonJVJ.h
|
menu.o : taille.h menu.h nbjoueur.h
|
||||||
|
|
||||||
taille.o : taille.h jeu.h
|
taille.o : taille.h
|
||||||
|
|
||||||
effacehaut.o : effacehaut.h
|
coordoner.o : coordoner.h initialisation.h
|
||||||
|
|
||||||
coordoner.o : coordoner.h
|
|
||||||
|
|
||||||
verificationblock.o : verificationblock.h
|
|
||||||
|
|
||||||
initialisation.o : initialisation.h
|
initialisation.o : initialisation.h
|
||||||
|
|
||||||
nbjoueur.o : nbjoueur.h
|
nbjoueur.o : nbjoueur.h
|
||||||
|
|
||||||
comportementJCJ.o : comportementJCJ.h definirMaxXY.h initialisation.h coordoner.h effacehaut.h verificationblock.h
|
comportementJCJ.o : comportementJCJ.h definirMaxXY.h initialisation.h coordoner.h
|
||||||
|
|
||||||
comportementJCIA.o : comportementJCIA.h
|
comportementJCIA.o : comportementJCIA.h definirMaxXY.h initialisation.h coordoner.h
|
||||||
|
|
||||||
boutonJVJ.o : boutonJVJ.h
|
main.o : menu.h comportementJCJ.h comportementJCIA.h
|
||||||
|
|
||||||
nbjoueur2.o : nbjoueur2.h
|
|
||||||
|
|
||||||
jeu.o : jeu.h menu.h comportementJCJ.h comportementJCIA.h
|
|
||||||
|
|
||||||
main.o : jeu.h
|
|
||||||
|
|
||||||
|
|
||||||
# CHAPITRE 4 : DEPENDANCES AVEC COMMANDES
|
# CHAPITRE 4 : DEPENDANCES AVEC COMMANDES
|
||||||
|
|||||||
19
boutonJVJ.c
19
boutonJVJ.c
@@ -1,19 +0,0 @@
|
|||||||
#include <graph.h>
|
|
||||||
|
|
||||||
/* Fonction qui permet de délimiter le clique de la souris pour le bouton de Joueur contre Joueur */
|
|
||||||
|
|
||||||
int boutonJVJ(){
|
|
||||||
int choix = 0, SourisX = 0, SourisY = 0;
|
|
||||||
while(choix == 0){ /* Boucle effectif tant que le joueur n'a pas fais de choix */
|
|
||||||
if (SourisCliquee()){ /* Détecte quand le joueur clique et met les coordonées du clique de SourisX et Souris Y */
|
|
||||||
SourisX = _X;
|
|
||||||
SourisY = _Y;
|
|
||||||
}
|
|
||||||
if(SourisX > 100 && SourisX < 250 && SourisY > 150 && SourisY < 200){
|
|
||||||
choix = 1; /* Quand le joueur clique dans l'emplacement de Joueur contre Joueur choix = 1 */
|
|
||||||
}else if(SourisX > 400 && SourisX < 550 && SourisY > 150 && SourisY < 200){
|
|
||||||
choix = 2; /* Quand le joueur cliqye dans l'emplacement de Joueur contre IA choix = 2 */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return choix; /* On retourne choix pour que le menu puisse le retourner a jeu.c pour faire la selection de l'ennemie */
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#ifndef BOUTONJVJ_H
|
|
||||||
#define BOUTONJVIA_H
|
|
||||||
|
|
||||||
|
|
||||||
int boutonJVJ();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -4,8 +4,6 @@
|
|||||||
#include "definirMaxXY.h"
|
#include "definirMaxXY.h"
|
||||||
#include "initialisation.h"
|
#include "initialisation.h"
|
||||||
#include "coordoner.h"
|
#include "coordoner.h"
|
||||||
#include "effacehaut.h"
|
|
||||||
#include "verificationblock.h"
|
|
||||||
|
|
||||||
|
|
||||||
int compJCIA(int taille){
|
int compJCIA(int taille){
|
||||||
@@ -14,6 +12,7 @@ int compJCIA(int taille){
|
|||||||
int emplacementcooX1 = 0, emplacementcooX2 = 0, emplacementcooY1 = 0, emplacementcooY2 = 0;
|
int emplacementcooX1 = 0, emplacementcooX2 = 0, emplacementcooY1 = 0, emplacementcooY2 = 0;
|
||||||
int grille[taille+2][taille+2];
|
int grille[taille+2][taille+2];
|
||||||
int empblock[4] = {0, 0, 0, 0}, empperso[4] = {0, 0, 0, 0};
|
int empblock[4] = {0, 0, 0, 0}, empperso[4] = {0, 0, 0, 0};
|
||||||
|
srand(time(NULL));
|
||||||
maxX = DefMaxX(taille);
|
maxX = DefMaxX(taille);
|
||||||
maxY = DefMaxY(taille);
|
maxY = DefMaxY(taille);
|
||||||
for(tabx = 0; tabx < taille + 2; tabx++){
|
for(tabx = 0; tabx < taille + 2; tabx++){
|
||||||
@@ -42,7 +41,7 @@ int compJCIA(int taille){
|
|||||||
initialiser++;
|
initialiser++;
|
||||||
SourisX = 0;
|
SourisX = 0;
|
||||||
SourisY = 0;
|
SourisY = 0;
|
||||||
Efface();
|
EffaceIA();
|
||||||
EcrireTexte(30, 40, "Joueur 2 choisissez l'emplacement de base du pion 2", 1);
|
EcrireTexte(30, 40, "Joueur 2 choisissez l'emplacement de base du pion 2", 1);
|
||||||
}
|
}
|
||||||
}else if (initialiser == 1){
|
}else if (initialiser == 1){
|
||||||
@@ -69,7 +68,7 @@ int compJCIA(int taille){
|
|||||||
ChargerSprite("croix2.png");
|
ChargerSprite("croix2.png");
|
||||||
while(fin == 0){
|
while(fin == 0){
|
||||||
if(tour == 0){
|
if(tour == 0){
|
||||||
Efface();
|
EffaceIA();
|
||||||
EcrireTexte(30, 40, "Tour du joueur 1", 2);
|
EcrireTexte(30, 40, "Tour du joueur 1", 2);
|
||||||
SourisX = 0;
|
SourisX = 0;
|
||||||
SourisY = 0;
|
SourisY = 0;
|
||||||
@@ -108,7 +107,7 @@ int compJCIA(int taille){
|
|||||||
placer = 1;
|
placer = 1;
|
||||||
tour++;
|
tour++;
|
||||||
}else if(tour == 1){
|
}else if(tour == 1){
|
||||||
Efface();
|
EffaceIA();
|
||||||
EcrireTexte(30, 40, "Joueur 1 place le bloc", 2);
|
EcrireTexte(30, 40, "Joueur 1 place le bloc", 2);
|
||||||
SourisX = 0;
|
SourisX = 0;
|
||||||
SourisY = 0;
|
SourisY = 0;
|
||||||
@@ -132,7 +131,7 @@ int compJCIA(int taille){
|
|||||||
placer = 1;
|
placer = 1;
|
||||||
tour++;
|
tour++;
|
||||||
}else if(tour == 2){
|
}else if(tour == 2){
|
||||||
Efface();
|
EffaceIA();
|
||||||
EcrireTexte(30, 40, "Tour du joueur 2", 2);
|
EcrireTexte(30, 40, "Tour du joueur 2", 2);
|
||||||
SourisX = 0;
|
SourisX = 0;
|
||||||
SourisY = 0;
|
SourisY = 0;
|
||||||
@@ -170,7 +169,7 @@ int compJCIA(int taille){
|
|||||||
tour++;
|
tour++;
|
||||||
|
|
||||||
}else if(tour == 3){
|
}else if(tour == 3){
|
||||||
Efface();
|
EffaceIA();
|
||||||
EcrireTexte(30, 40, "Joueur 2 place le bloc", 2);
|
EcrireTexte(30, 40, "Joueur 2 place le bloc", 2);
|
||||||
SourisX = 0;
|
SourisX = 0;
|
||||||
SourisY = 0;
|
SourisY = 0;
|
||||||
@@ -194,3 +193,10 @@ int compJCIA(int taille){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void EffaceIA(){
|
||||||
|
ChoisirCouleurDessin(CouleurParNom("white"));
|
||||||
|
RemplirRectangle(0, 0, 650, 50);
|
||||||
|
ChoisirCouleurDessin(CouleurParNom("black"));
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,5 +4,6 @@
|
|||||||
|
|
||||||
void compJCIA(int taille);
|
void compJCIA(int taille);
|
||||||
|
|
||||||
|
void EffaceIA();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
#include "definirMaxXY.h"
|
#include "definirMaxXY.h"
|
||||||
#include "initialisation.h"
|
#include "initialisation.h"
|
||||||
#include "coordoner.h"
|
#include "coordoner.h"
|
||||||
#include "effacehaut.h"
|
|
||||||
#include "verificationblock.h"
|
|
||||||
|
|
||||||
|
|
||||||
int compJCJ(int taille){
|
int compJCJ(int taille){
|
||||||
@@ -195,4 +193,11 @@ int compJCJ(int taille){
|
|||||||
tour = 0;
|
tour = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Efface(){
|
||||||
|
ChoisirCouleurDessin(CouleurParNom("white"));
|
||||||
|
RemplirRectangle(0, 0, 650, 50);
|
||||||
|
ChoisirCouleurDessin(CouleurParNom("black"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,5 +4,6 @@
|
|||||||
|
|
||||||
int compJCJ(int taille);
|
int compJCJ(int taille);
|
||||||
|
|
||||||
|
void Efface();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
14
coordoner.c
14
coordoner.c
@@ -1,3 +1,5 @@
|
|||||||
|
#include "initialisation.h"
|
||||||
|
|
||||||
int coordonerX(int SourisX){
|
int coordonerX(int SourisX){
|
||||||
int x = 0, z = 0;
|
int x = 0, z = 0;
|
||||||
for(z = 50; z <= 500; z += 50){
|
for(z = 50; z <= 500; z += 50){
|
||||||
@@ -18,3 +20,15 @@ int coordonerY(int SourisY){
|
|||||||
}
|
}
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void VerifBlock1(int SourisX, int SourisY, int maxX, int maxY, int taille, int* coordoner){
|
||||||
|
int placementX = 0, placementY = 0;
|
||||||
|
if(SourisX >= 50 && SourisX <= maxX && SourisY >= 100 && SourisY <= maxY){
|
||||||
|
placementX = initialisationXbox(SourisX, maxX, taille);
|
||||||
|
placementY = initialisationYbox(SourisY, maxY, taille);
|
||||||
|
}
|
||||||
|
coordoner[0] = placementX;
|
||||||
|
coordoner[1] = placementY;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,6 @@ int coordonerX(int SourisX);
|
|||||||
|
|
||||||
int coordonerY(int SourisY);
|
int coordonerY(int SourisY);
|
||||||
|
|
||||||
|
void VerifBlock1(int SourisX, int SourisY, int maxX, int maxY, int taille, int* coordoner);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
#include <graph.h>
|
|
||||||
|
|
||||||
|
|
||||||
void Efface(void){
|
|
||||||
ChoisirCouleurDessin(CouleurParNom("white"));
|
|
||||||
RemplirRectangle(0, 0, 650, 50);
|
|
||||||
ChoisirCouleurDessin(CouleurParNom("black"));
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#ifndef EFFACEHAUT_H
|
|
||||||
#define EFFACEHAUT_H
|
|
||||||
|
|
||||||
|
|
||||||
void Efface();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
27
grille.c
27
grille.c
@@ -1,27 +0,0 @@
|
|||||||
#include <graph.h>
|
|
||||||
|
|
||||||
|
|
||||||
void Grille(int taille){
|
|
||||||
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 */
|
|
||||||
x += 50;
|
|
||||||
}
|
|
||||||
x -= 50; /* Enlève le surplus de la fonction for */
|
|
||||||
for(bord = 0; bord <= taille; bord++){
|
|
||||||
DessinerSegment(50, 100, 50 , y); /* Dessine les barre latérale en fonction de la taille choisie */
|
|
||||||
DessinerSegment(x, 100, x, y);
|
|
||||||
y += 50;
|
|
||||||
}
|
|
||||||
y -= 50; /* Enlève le surplus de la fonction for */
|
|
||||||
DessinerSegment(50, y, x, y);
|
|
||||||
for(bord = 0; bord <= taille; bord++){
|
|
||||||
DessinerSegment(50, yy, x, yy); /* Dessine les barre horizontale de l'intérieur de la grille */
|
|
||||||
yy += 50;
|
|
||||||
}
|
|
||||||
for(bord = 0; bord <= taille; bord++){
|
|
||||||
DessinerSegment(xx, 100, xx, y); /* Dessine les barre verticale de l'intérieur de la grille */
|
|
||||||
xx += 50;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
26
jeu.c
26
jeu.c
@@ -1,26 +0,0 @@
|
|||||||
#include <graph.h>
|
|
||||||
|
|
||||||
#include "menu.h"
|
|
||||||
#include "comportementJCJ.h"
|
|
||||||
#include "comportementJCIA.h"
|
|
||||||
|
|
||||||
int Jeu(){
|
|
||||||
int choix[2], taille = 0, victoire = 0;
|
|
||||||
Menu(choix);
|
|
||||||
taille = choix[1];
|
|
||||||
if(choix[0] == 1){
|
|
||||||
victoire = compJCJ(taille);
|
|
||||||
if(victoire == 1){
|
|
||||||
return 1;
|
|
||||||
}else if(victoire == 2){
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
}else if (choix[0] == 2){
|
|
||||||
compJCIA(taille);
|
|
||||||
if(victoire == 1){
|
|
||||||
return 1;
|
|
||||||
}else if(victoire == 3){
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
24
main.c
24
main.c
@@ -1,7 +1,10 @@
|
|||||||
#include <graph.h>
|
#include <graph.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "jeu.h"
|
|
||||||
|
#include "menu.h"
|
||||||
|
#include "comportementJCJ.h"
|
||||||
|
#include "comportementJCIA.h"
|
||||||
|
|
||||||
int main (void){
|
int main (void){
|
||||||
int victoire = 0, choix = 0, SourisX = 0, SourisY = 0;
|
int victoire = 0, choix = 0, SourisX = 0, SourisY = 0;
|
||||||
@@ -32,11 +35,11 @@ int main (void){
|
|||||||
choix = 5;
|
choix = 5;
|
||||||
}
|
}
|
||||||
if(victoire == 1){
|
if(victoire == 1){
|
||||||
EcrireTexte(300, 235, "Joueur 1 a gagner !", 2);
|
EcrireTexte(200, 235, "Joueur 1 a gagner !", 2);
|
||||||
}else if (victoire == 2){
|
}else if (victoire == 2){
|
||||||
EcrireTexte(300, 235, "Joueur 2 a gagner !", 2);
|
EcrireTexte(200, 235, "Joueur 2 a gagner !", 2);
|
||||||
}else if (victoire == 3){
|
}else if (victoire == 3){
|
||||||
EcrireTexte(300, 235, "L'IA a gagner !", 2);
|
EcrireTexte(200, 235, "L'IA a gagner !", 2);
|
||||||
}
|
}
|
||||||
if(choix == 5){
|
if(choix == 5){
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
@@ -44,3 +47,16 @@ int main (void){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int Jeu(){
|
||||||
|
int choix[2], taille = 0, victoire = 0;
|
||||||
|
Menu(choix);
|
||||||
|
taille = choix[1];
|
||||||
|
if(choix[0] == 1){
|
||||||
|
victoire = compJCJ(taille);
|
||||||
|
}else if (choix[0] == 2){
|
||||||
|
compJCIA(taille);
|
||||||
|
}
|
||||||
|
return victoire;
|
||||||
|
}
|
||||||
|
|||||||
24
menu.c
24
menu.c
@@ -2,11 +2,9 @@
|
|||||||
|
|
||||||
#include "taille.h"
|
#include "taille.h"
|
||||||
#include "nbjoueur.h"
|
#include "nbjoueur.h"
|
||||||
#include "nbjoueur2.h"
|
|
||||||
#include "boutonJVJ.h"
|
|
||||||
|
|
||||||
|
|
||||||
int Menu(int *retour) {
|
void Menu(int *retour) {
|
||||||
int x = 50, y = 50, taille = -5, choix = 0, echotaille = 0, verrou = 0; /* initialisation des variable */
|
int x = 50, y = 50, taille = -5, choix = 0, echotaille = 0, verrou = 0; /* initialisation des variable */
|
||||||
couleur c = CouleurParNom("white");
|
couleur c = CouleurParNom("white");
|
||||||
while(choix == 0){ /* Condition pour que le menu s'arrête quand le joueur aura selectionner le nombre de joueur */
|
while(choix == 0){ /* Condition pour que le menu s'arrête quand le joueur aura selectionner le nombre de joueur */
|
||||||
@@ -66,3 +64,23 @@ void Grille(int taille){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Fonction qui permet de délimiter le clique de la souris pour le bouton de Joueur contre Joueur */
|
||||||
|
|
||||||
|
int boutonJVJ(){
|
||||||
|
int choix = 0, SourisX = 0, SourisY = 0;
|
||||||
|
while(choix == 0){ /* Boucle effectif tant que le joueur n'a pas fais de choix */
|
||||||
|
if (SourisCliquee()){ /* Détecte quand le joueur clique et met les coordonées du clique de SourisX et Souris Y */
|
||||||
|
SourisX = _X;
|
||||||
|
SourisY = _Y;
|
||||||
|
}
|
||||||
|
if(SourisX > 100 && SourisX < 250 && SourisY > 150 && SourisY < 200){
|
||||||
|
choix = 1; /* Quand le joueur clique dans l'emplacement de Joueur contre Joueur choix = 1 */
|
||||||
|
}else if(SourisX > 400 && SourisX < 550 && SourisY > 150 && SourisY < 200){
|
||||||
|
choix = 2; /* Quand le joueur cliqye dans l'emplacement de Joueur contre IA choix = 2 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return choix; /* On retourne choix pour que le menu puisse le retourner a jeu.c pour faire la selection de l'ennemie */
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
4
menu.h
4
menu.h
@@ -2,8 +2,10 @@
|
|||||||
#define MENU_H
|
#define MENU_H
|
||||||
|
|
||||||
|
|
||||||
int Menu(int *retour);
|
void Menu(int *retour);
|
||||||
|
|
||||||
void Grille(int taille);
|
void Grille(int taille);
|
||||||
|
|
||||||
|
int boutonJCJ();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
23
nbjoueur.c
23
nbjoueur.c
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int nbjoueur(){
|
void nbjoueur(){
|
||||||
int x = 100, xx = 250, y = 150, l = 30, h = 30, angle1 = 20, angle2 = 30;
|
int x = 100, xx = 250, y = 150, l = 30, h = 30, angle1 = 20, angle2 = 30;
|
||||||
ChoisirCouleurDessin(CouleurParNom("Black"));
|
ChoisirCouleurDessin(CouleurParNom("Black"));
|
||||||
DessinerSegment(x, y, xx, y);
|
DessinerSegment(x, y, xx, y);
|
||||||
@@ -20,3 +20,24 @@ int nbjoueur(){
|
|||||||
DessinerSegment(x - 8, y + 9, x - 8, y + 43);
|
DessinerSegment(x - 8, y + 9, x - 8, y + 43);
|
||||||
DessinerSegment(xx + 6, y + 8, xx + 6, y + 43);
|
DessinerSegment(xx + 6, y + 8, xx + 6, y + 43);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Fonction qui permet de déssiner le bouton du joueur contre IA
|
||||||
|
*/
|
||||||
|
|
||||||
|
void nbjoueur2(){
|
||||||
|
int x = 400, xx = 550, y = 150, l = 30, h = 30, angle1 = 20, angle2 = 30;
|
||||||
|
ChoisirCouleurDessin(CouleurParNom("Black"));
|
||||||
|
DessinerSegment(x, y, xx, y);
|
||||||
|
DessinerSegment(x - 2, y + 50, xx, y + 50);
|
||||||
|
EcrireTexte(x + 10, y + 35, "J1 VS IA", 2);
|
||||||
|
DessinerArc(xx - 23, y - 3, l, h, angle1, angle2);
|
||||||
|
DessinerArc(x - 9, y - 2, l, h, angle1 + 100, angle2 + 10);
|
||||||
|
DessinerArc(xx - 23, y + 23, l, h, angle1 + 290, angle2);
|
||||||
|
DessinerArc(x - 9, y + 23, l, h, angle1 + 180, angle2);
|
||||||
|
DessinerSegment(x - 8, y + 9, x - 8, y + 43);
|
||||||
|
DessinerSegment(xx + 6, y + 8, xx + 6, y + 43);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
#define NBJOUEUR_H
|
#define NBJOUEUR_H
|
||||||
|
|
||||||
|
|
||||||
int nbjoueur();
|
void nbjoueur();
|
||||||
|
|
||||||
|
void nbjoueur2();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
23
nbjoueur2.c
23
nbjoueur2.c
@@ -1,23 +0,0 @@
|
|||||||
#include <graph.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Fonction qui permet de déssiner le bouton du joueur contre IA
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int nbjoueur2(){
|
|
||||||
int x = 400, xx = 550, y = 150, l = 30, h = 30, angle1 = 20, angle2 = 30;
|
|
||||||
ChoisirCouleurDessin(CouleurParNom("Black"));
|
|
||||||
DessinerSegment(x, y, xx, y);
|
|
||||||
DessinerSegment(x - 2, y + 50, xx, y + 50);
|
|
||||||
EcrireTexte(x + 10, y + 35, "J1 VS IA", 2);
|
|
||||||
DessinerArc(xx - 23, y - 3, l, h, angle1, angle2);
|
|
||||||
DessinerArc(x - 9, y - 2, l, h, angle1 + 100, angle2 + 10);
|
|
||||||
DessinerArc(xx - 23, y + 23, l, h, angle1 + 290, angle2);
|
|
||||||
DessinerArc(x - 9, y + 23, l, h, angle1 + 180, angle2);
|
|
||||||
DessinerSegment(x - 8, y + 9, x - 8, y + 43);
|
|
||||||
DessinerSegment(xx + 6, y + 8, xx + 6, y + 43);
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#ifndef NBJOUEUR2_H
|
|
||||||
#define NBJOUEUR2_H
|
|
||||||
|
|
||||||
|
|
||||||
int nbjoueur2();
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
2
taille.c
2
taille.c
@@ -82,7 +82,5 @@ int GererChoixTaille(){
|
|||||||
taille = 9;
|
taille = 9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(taille != 0){
|
|
||||||
return taille;
|
return taille;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#include <graph.h>
|
|
||||||
|
|
||||||
#include "initialisation.h"
|
|
||||||
|
|
||||||
|
|
||||||
int VerifBlock1(int SourisX, int SourisY, int maxX, int maxY, int taille, int* coordoner){
|
|
||||||
int placementX = 0, placementY = 0;
|
|
||||||
if(SourisX >= 50 && SourisX <= maxX && SourisY >= 100 && SourisY <= maxY){
|
|
||||||
placementX = initialisationXbox(SourisX, maxX, taille);
|
|
||||||
placementY = initialisationYbox(SourisY, maxY, taille);
|
|
||||||
}
|
|
||||||
coordoner[0] = placementX;
|
|
||||||
coordoner[1] = placementY;
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#ifndef VERIFICATIONBLOCK_H
|
|
||||||
#define VERIFICATIONBLOCK_H
|
|
||||||
|
|
||||||
int VerifBlock1(int SourisX, int SourisY, int maxX, int maxY, int taille, int* coordoner);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Reference in New Issue
Block a user