#include #include #include "../Graphique/libgraph.h" #include "../ListeC/Liste.h" #include "Interactif.h" #define TailleX 500 #define TailleY 500 void Tirer(struct entite joueur, struct liste_entite **pl) { struct liste_entite *ml=*pl; if (ml==NULL) { ajout_tete(pl,creer_entite(joueur.posx+18,joueur.posy-5,0)); } } void DeplacementTire(int tire, int explo, struct liste_entite **l) { struct liste_entite *ml = *l; while (ml != NULL) { if (ml->enti.posy <= 0) { *l = NULL; afficherLutin(explo, ml->enti.posx-20, ml->enti.posy); break; } else { ml->enti.posy -= 5; afficherLutin(tire, ml->enti.posx, ml->enti.posy); ml = ml->suivant; } } } char touche() { char touche; evenement even; lireEvenement (&even,&touche,NULL); return touche; } void action(struct entite *joueur,char c,struct liste_entite **tires) { if(c=='d') { if (joueur->posx<=9*TailleX/10) {joueur->posx+=3;} } if(c=='q') { if (joueur->posx>=TailleX/10) {joueur->posx-=3;} } if(c=='t'){Tirer(*joueur,tires);} }