initialisation

This commit is contained in:
2024-11-15 09:50:42 +01:00
parent c01961ff3c
commit f2880c2bbf
6 changed files with 78 additions and 9 deletions

View File

@@ -2,9 +2,17 @@
#include <stdio.h>
#include "definirMaxXY.h"
#include "initialisation.h"
void compJCJ(int taille){
int fin = 0, tabx = 0, taby = 0, tour = 0, initialisation = 0, SourisX = 0, SourisY = 0, x = 50, y = 100;
int fin = 0, tabx = 0, taby = 0, tour = 0, initi = 0, SourisX = 0, SourisY = 0, x = 50, y = 100, initialiser = 0;
int maxX = 0, maxY = 0;
int grille[taille+2][taille+2];
maxX = DefMaxX(taille);
maxY = DefMaxY(taille);
for(tabx = 0; tabx < taille + 2; tabx++){
for(taby = 0; taby < taille + 2; taby++){
grille[tabx][taby] = 0;
@@ -16,19 +24,19 @@ void compJCJ(int taille){
printf("\n");
}
EcrireTexte(30, 40, "Joueur 1 choisissez l'emplacement de base du pion 1", 1);
while(initialisation == 0){
while(initi == 0){
if(SourisCliquee()){
SourisX = _X;
SourisY = _Y;
printf("%d, %d\n", SourisX, SourisY);
printf("max X Y : %d, %d\n", maxX, maxY);
}
for(y = 100; y < taille * 75; y += 50){
for(x = 50; x < taille * 75; x += 50){
if(SourisX >= x && SourisY >= y && SourisX <= x + 50 && SourisY <= y + 50){
printf("test\n");
DessinerSegment(0, 0, 500, 500);
}
if(initialiser == 0){
if(SourisX >= 200 && SourisX <= maxX && SourisY >= 250 && SourisY <= maxY){
printf("entre max\n");
initialisation(SourisX, SourisY, maxX, maxY);
}
}else if (initialiser == 1){
}
}
while(fin == 0){