1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
void printcochon(COCHON cochonpara)
{
int b = 0;
COCHON cochontemp = malloc(sizeof(COCHON));
cochontemp = cochonpara;
SetFgColor(Z0,GetRGBColor(0,0,255));/*fonction de la librairie libsx*/
colisioncochon(cochontemp);
while(cochontemp != NULL)
{
if(cochontemp->dead == 0)
{
b = 1;
DrawText("PIG",cochontemp->cochonx,cochontemp->cochony); /*libsx*/
}
else
{
/* 20 est la taille de la case*/
DrawFilledBox(cochontemp->cochonx-X0,cochontemp->cochony-Y0,20 ,20); /*libsx*/
}
cochontemp=cochontemp->suivant;
}
if(b==0) /*si tous les cochons sont morts*/
{
draw();
initloup(loup.nbvie);
initcochon(nbcochon=nbcochon*2);
niveau++;
affniv (niveau);
}
} |