Ajout des tableaux de coordonnées avec David
This commit is contained in:
parent
620d49450f
commit
99c2c072d8
11
main.c
11
main.c
@ -41,7 +41,7 @@ void gen_pastille(int nb_pastille, int *p_pastilles) /* Ajout des pointeurs pour
|
|||||||
|
|
||||||
srand(time(NULL));
|
srand(time(NULL));
|
||||||
|
|
||||||
for(i=0;i<nb_pastille;i++)
|
for(i=0;i<nb_pastille*2;i+=2)
|
||||||
{
|
{
|
||||||
|
|
||||||
x_pastille= ArrondirPixel(rand()%W_GAME);
|
x_pastille= ArrondirPixel(rand()%W_GAME);
|
||||||
@ -64,7 +64,10 @@ void gen_pastille(int nb_pastille, int *p_pastilles) /* Ajout des pointeurs pour
|
|||||||
y_pastille - DECALEMENT;
|
y_pastille - DECALEMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*printf("x : %d ; y : %d\n",x_pastille,y_pastille); DEBUG*/
|
p_pastilles[i] = x_pastille ;
|
||||||
|
p_pastilles[i+1] = y_pastille ;
|
||||||
|
|
||||||
|
printf("x : %d ; y : %d\n",p_pastilles[i],p_pastilles[i+1]);
|
||||||
|
|
||||||
ChoisirCouleurDessin(r);
|
ChoisirCouleurDessin(r);
|
||||||
RemplirRectangle(x_pastille,y_pastille,T_PIXEL,T_PIXEL);
|
RemplirRectangle(x_pastille,y_pastille,T_PIXEL,T_PIXEL);
|
||||||
@ -88,8 +91,8 @@ void InitialisationDuSerpent(int *p_serpent) /* L'initialisation du serpent */
|
|||||||
couleur j;
|
couleur j;
|
||||||
j=CouleurParNom("yellow");
|
j=CouleurParNom("yellow");
|
||||||
ChoisirCouleurDessin(j);
|
ChoisirCouleurDessin(j);
|
||||||
x_millieu = ArrondirPixel(T_PIXEL*30);
|
x_millieu = T_PIXEL*30; /* 30 = 60 colonnes divisé par 2*/
|
||||||
y_millieu = ArrondirPixel(T_PIXEL*20);
|
y_millieu = T_PIXEL*20; /* 20 = 40 colonnes divisé par 2*/
|
||||||
RemplirRectangle(x_millieu,y_millieu,T_PIXEL,T_PIXEL);
|
RemplirRectangle(x_millieu,y_millieu,T_PIXEL,T_PIXEL);
|
||||||
|
|
||||||
/* printf("x_millieu : %d | y_millieu : %d\n",x_millieu,y_millieu); DEBUG*/
|
/* printf("x_millieu : %d | y_millieu : %d\n",x_millieu,y_millieu); DEBUG*/
|
||||||
|
BIN
prog
BIN
prog
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user