Commit 65adbf2e561c7b4396362fc2a2974f75eb40796c
1 parent
2fd95d7e
1ere Version tierce
Showing
1 changed file
with
12 additions
and
4 deletions
Show diff stats
Main/main.c
... | ... | @@ -19,6 +19,14 @@ char touche() |
19 | 19 | return touche; |
20 | 20 | } |
21 | 21 | |
22 | +void action(struct entite *joueur,char c,struct liste_entite **tires) | |
23 | +{ | |
24 | + if(c=='d'){joueur->posx+=3;} | |
25 | + if(c=='q'){joueur->posx-=3;} | |
26 | + if(c=='t'){Tirer(*joueur,tires);} | |
27 | +} | |
28 | + | |
29 | + | |
22 | 30 | int main() |
23 | 31 | { |
24 | 32 | struct liste_entite *enemies = NULL; |
... | ... | @@ -37,9 +45,8 @@ int main() |
37 | 45 | |
38 | 46 | struct liste_entite *tires = NULL; |
39 | 47 | creer_liste(tires); |
40 | - //ajout_tete(&tires,creer_entite(225,470,0)); | |
41 | - Tirer(joueur,&tires); | |
42 | - imprimer_liste(tires); | |
48 | + //Tirer(joueur,&tires); | |
49 | + //imprimer_liste(tires); | |
43 | 50 | int missile = chargerLutin("../../Lutins/invader_missile.bmp",COULEUR_NOIR); |
44 | 51 | |
45 | 52 | char Nom[20]="PremiereFenetre"; |
... | ... | @@ -52,7 +59,8 @@ int main() |
52 | 59 | DeplacementLutin(lulu,enemies,psens,1); |
53 | 60 | |
54 | 61 | char c = touche(); |
55 | - printf("%c",c); | |
62 | + action(&joueur,c,&tires); | |
63 | + | |
56 | 64 | DeplacementTire(missile,tires); |
57 | 65 | |
58 | 66 | majSurface(); | ... | ... |