avancement

This commit is contained in:
Maxim LALANE 2023-11-30 15:12:15 +01:00
parent 0b0bb215bf
commit d5f556dce5
2 changed files with 5 additions and 5 deletions

BIN
cc

Binary file not shown.

View File

@ -110,18 +110,18 @@ int DepYTete(unsigned long suivant2,int sxmax,int symax,int direction,int tab[H]
/*mvmt du serpent*/
void Serpent(int tab[H][L], int* psxmax, int* psxmin, int* psymax, int*psymin, int* pdirection){
void Serpent(int tab[H][L], int* psxmax, int* psxmin, int* psymax, int* psymin, int* pdirection){
unsigned long suivant2=Microsecondes()+DELTO;
pdirection = CliqueTouche(tab,pdirection);
*pdirection = CliqueTouche(tab,pdirection);
/*deplacement tete*/
if(Microsecondes()>=suivant2){
if(pdirection==0||pdirection==2){
psxmax=DepXTete(suivant2,psxmax,psymax,pdirection,tab);
*psxmax=DepXTete(suivant2,psxmax,psymax,pdirection,tab);
}
else if(pdirection==1||pdirection==3){
psymax=DepYTete(suivant2,psxmax,psymax,pdirection,tab);
*psymax=DepYTete(suivant2,psxmax,psymax,pdirection,tab);
}
suivant2=Microsecondes()+DELTO;
}
@ -176,7 +176,7 @@ int main(void){
while(1){
Affiche(tab);
Serpent(tab);
Serpent(tab, *psxmax, *psxmin, *psymax,*psymin,*pdirection);
/*timer*/
if(Microsecondes()>suivant){