#include #include #include "../Graphique/libgraph.h" #include "../ListeC/Liste.h" #include "Monstre.h" //sens 1 = Va vers la droite void DeplacementLutin(int lutin,struct liste_entite *l, int *psens, int speed) { int ind=0; struct liste_entite *ml=l; while(ml != NULL) { if (*psens==1) { ml->enti.posx+=speed; if(ml->enti.posx>=450)ind=1; afficherLutin(lutin,ml->enti.posx,ml->enti.posy); } else { ml->enti.posx-=speed; if(ml->enti.posx<=50)ind=2; afficherLutin(lutin,ml->enti.posx,ml->enti.posy); } ml=ml->suivant; } if (ind==1) { *psens=0; struct liste_entite *ml2=l; while(ml2 != NULL) { ml2->enti.posy+=30; ml2=ml2->suivant; } } else if (ind==2) { *psens=1; struct liste_entite *ml2=l; while(ml2 != NULL) { ml2->enti.posy+=30; ml2=ml2->suivant; } } }