Commit a6652f45a7eed8c613451e7b30adda19a19bd11d
1 parent
9afa598e
rapport intermediaire
Showing
1 changed file
with
14 additions
and
36 deletions
Show diff stats
test2.h
1 | #ifndef MAIN_H | 1 | #ifndef MAIN_H |
2 | #define MAIN_H | 2 | #define MAIN_H |
3 | 3 | ||
4 | -#include <SDL/SDL.h> | ||
5 | -#include <SDL/SDL_ttf.h> | 4 | +#include <stdio.h> |
5 | +#include <stdlib.h> | ||
6 | +#define TAILLE_X 700 | ||
6 | 7 | ||
7 | -#define LARGEUR_ECRAN 800 | ||
8 | -#define HAUTEUR_ECRAN 600 | ||
9 | -#define ESPACEMENT_MONSTRES 40 | ||
10 | -#define NB_MONSTRES 10 | ||
11 | 8 | ||
12 | -#define VAISSEAU_X (LARGEUR_ECRAN / 2) | ||
13 | -#define VAISSEAU_Y (HAUTEUR_ECRAN - 30) | ||
14 | -#define MONSTRE_Y 30 | 9 | +typedef struct entite |
10 | +{int image;int x;int y;int speed;}entite; | ||
15 | 11 | ||
16 | -#include <stdbool.h> | ||
17 | 12 | ||
13 | +typedef struct l_entite | ||
14 | +{entite ent;struct l_entite* next;}l_entite; | ||
18 | 15 | ||
19 | -typedef struct entite { | ||
20 | - int x, y; | ||
21 | - int type; | ||
22 | - int etat; | ||
23 | - struct entite* suivante; | ||
24 | -} entite; | 16 | +l_entite* create_l_entite (int x,int y,int speed,int image); |
17 | +entite create_entite (entite ent,int x,int y, int speed, int image); | ||
18 | +void add_entite (l_entite** head,int x,int y,int speed,int image); | ||
19 | +void display_l_entite (l_entite* mons); | ||
20 | +void display_entite (entite ent); | ||
21 | +void moveMissile (l_entite* msl); | ||
25 | 22 | ||
26 | - | ||
27 | -typedef struct listeEntites { | ||
28 | - entite* tete; | ||
29 | -} listeEntites; | ||
30 | - | ||
31 | - | ||
32 | -void initListe(listeEntites* liste); | ||
33 | -void ajouterEntite(listeEntites* liste, int x, int y, int type, int etat); | ||
34 | -void initEnvahisseurs(listeEntites* liste, int nbEnvahisseurs, int y); | ||
35 | -void initVaisseau(entite* vaisseau, int x, int y); | ||
36 | - | ||
37 | - | ||
38 | -void deplacerEnvahisseurs(listeEntites* envahisseurs, int largeurEcran, int* direction, bool* bordAtteint); | ||
39 | -void gererEntrees(entite* vaisseau, listeEntites* missiles); | ||
40 | - | ||
41 | - | ||
42 | -bool collision(entite* a, entite* b); | ||
43 | -entite* collisionAvecListe(entite* ent, listeEntites* liste); | ||
44 | - | ||
45 | -#endif | 23 | +#endif |
46 | \ No newline at end of file | 24 | \ No newline at end of file |