avancement
This commit is contained in:
parent
0b0bb215bf
commit
d5f556dce5
8
virage.c
8
virage.c
@ -113,15 +113,15 @@ int DepYTete(unsigned long suivant2,int sxmax,int symax,int direction,int tab[H]
|
|||||||
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;
|
unsigned long suivant2=Microsecondes()+DELTO;
|
||||||
|
|
||||||
pdirection = CliqueTouche(tab,pdirection);
|
*pdirection = CliqueTouche(tab,pdirection);
|
||||||
|
|
||||||
/*deplacement tete*/
|
/*deplacement tete*/
|
||||||
if(Microsecondes()>=suivant2){
|
if(Microsecondes()>=suivant2){
|
||||||
if(pdirection==0||pdirection==2){
|
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){
|
else if(pdirection==1||pdirection==3){
|
||||||
psymax=DepYTete(suivant2,psxmax,psymax,pdirection,tab);
|
*psymax=DepYTete(suivant2,psxmax,psymax,pdirection,tab);
|
||||||
}
|
}
|
||||||
suivant2=Microsecondes()+DELTO;
|
suivant2=Microsecondes()+DELTO;
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ int main(void){
|
|||||||
|
|
||||||
while(1){
|
while(1){
|
||||||
Affiche(tab);
|
Affiche(tab);
|
||||||
Serpent(tab);
|
Serpent(tab, *psxmax, *psxmin, *psymax,*psymin,*pdirection);
|
||||||
|
|
||||||
/*timer*/
|
/*timer*/
|
||||||
if(Microsecondes()>suivant){
|
if(Microsecondes()>suivant){
|
||||||
|
Loading…
Reference in New Issue
Block a user