correction segmentation collission
This commit is contained in:
@@ -40,20 +40,21 @@ void InitialiserPastilles(PIXELS *pastilles, PIXELS *serpent, int longueur_serpe
|
||||
}
|
||||
}
|
||||
|
||||
void MourrirSerpent(PIXELS *serpent, int longueur_serpent)
|
||||
int MourrirSerpent(PIXELS *serpent, int longueur_serpent)
|
||||
{
|
||||
int i = 0;
|
||||
for(i=1;i<longueur_serpent;i++)
|
||||
{
|
||||
if(serpent[0].x == serpent[i].x && serpent[0].y == serpent[i].y )
|
||||
{
|
||||
FermerGraphique();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (serpent[0].x<=0 || serpent[0].x>W_GAME || serpent[0].y<=0 || serpent[0].y>H_GAME)
|
||||
{
|
||||
FermerGraphique();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MangerPastille(PIXELS *serpent, PIXELS* pastilles,unsigned long *score,int longueur_serpent)
|
||||
|
||||
Reference in New Issue
Block a user