avancement
This commit is contained in:
parent
0b0bb215bf
commit
d5f556dce5
10
virage.c
10
virage.c
@ -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){
|
||||
|
Loading…
Reference in New Issue
Block a user