diff --git a/.#makefile b/.#makefile deleted file mode 120000 index de1983a..0000000 --- a/.#makefile +++ /dev/null @@ -1 +0,0 @@ -khadir@salle222-13.168261:1703162703 \ No newline at end of file diff --git a/Makefile b/Makefile index 38bdbb2..4ad9d34 100644 --- a/Makefile +++ b/Makefile @@ -16,9 +16,9 @@ pomme.o : pomme.h terrain.h serpent.h main.o : serpent.h pomme.h temps_et_score.h terrain.h -temps_et_score.o : temps_score.h +temps_et_score.o : temps_et_score.h -terrain.o : menu_terrain.h +terrain.o : terrain.h snake : $(OFILES) $(CC) $(CFLAGS) -o snake $(OFILES) -lgraph diff --git a/main.c b/main.c index 4e83479..facd422 100644 --- a/main.c +++ b/main.c @@ -2,10 +2,10 @@ #include #include #include -#include "menu_terrain.h" -#include "temps_score.h" +#include "terrain.h" +#include "temps_et_score.h" #include "serpent.h" -#include "pastille.h" +#include "pomme.h" #define CYCLE 1000000L #define MAX_LONGUEUR 100 diff --git a/main.o b/main.o index 3906dcc..1df624e 100644 Binary files a/main.o and b/main.o differ diff --git a/pastille.o b/pastille.o deleted file mode 100644 index 805c8ea..0000000 Binary files a/pastille.o and /dev/null differ diff --git a/pomme.c b/pomme.c index 50c6d96..650400d 100644 --- a/pomme.c +++ b/pomme.c @@ -49,6 +49,6 @@ void Validation_Coordonne(int nombre, Pastille pomme[], int longSerpent, Segment void Afficher_Pastille(int n,Pastille pomme[]){ int i; for (i = 0; i < n;i++){ - ChargerImage("pomme.png", pomme[i].x, pomme[i].y, 26,26, TAILLE_CASE, TAILLE_CASE); + ChargerImage("pomme.png", pomme[i].x, pomme[i].y, 0,0, TAILLE_CASE, TAILLE_CASE); } } \ No newline at end of file diff --git a/pomme.h b/pomme.h index 04bc2fd..6167298 100644 --- a/pomme.h +++ b/pomme.h @@ -1,6 +1,6 @@ #include "serpent.h" -#ifndef PASTILLE_H -#define PASTILLE_H +#ifndef POMME_H +#define POMME_H typedef struct { @@ -14,4 +14,4 @@ void Validation_Coordonne(int z, Pastille pomme[], int longSerpent, Segment serp #define NBR_PASTILLE_INITIAL 5 -#endif /* PASTILLE_H */ +#endif /* POMME_H */ diff --git a/pomme.h~ b/pomme.h~ new file mode 100644 index 0000000..04bc2fd --- /dev/null +++ b/pomme.h~ @@ -0,0 +1,17 @@ +#include "serpent.h" +#ifndef PASTILLE_H +#define PASTILLE_H + +typedef struct +{ + int x; + int y; +} Pastille; + +void Creation_Pastille(int z, Pastille pomme[], int longSerpent, Segment serpent[]); +void Afficher_Pastille(int z, Pastille pomme[]); +void Validation_Coordonne(int z, Pastille pomme[], int longSerpent, Segment serpent[], Pastille* nouvelle_pomme); + +#define NBR_PASTILLE_INITIAL 5 + +#endif /* PASTILLE_H */ diff --git a/pomme.o b/pomme.o index 5bb2d0a..b3ce460 100644 Binary files a/pomme.o and b/pomme.o differ diff --git a/pomme.png b/pomme.png index bdfc3de..6dc2906 100644 Binary files a/pomme.png and b/pomme.png differ diff --git a/snake b/snake index 9b3b919..fade43d 100755 Binary files a/snake and b/snake differ diff --git a/temps_et_score.h b/temps_et_score.h index a95c8e9..36b59f6 100644 --- a/temps_et_score.h +++ b/temps_et_score.h @@ -1,8 +1,8 @@ -#ifndef TEMPS_SCORE_H -#define TEMPS_SCORE_H +#ifndef TEMPS_ET_SCORE_H +#define TEMPS_ET_SCORE_H void Attendre(unsigned int millisecondes); void Afficher_Temps(int minutes, int secondes, char texte[]); void Afficher_Score(int score, char texte[]); -#endif /* TEMPS_SCORE_H */ +#endif /* TEMPS_ET_SCORE_H */ diff --git a/temps_et_score.h~ b/temps_et_score.h~ new file mode 100644 index 0000000..a95c8e9 --- /dev/null +++ b/temps_et_score.h~ @@ -0,0 +1,8 @@ +#ifndef TEMPS_SCORE_H +#define TEMPS_SCORE_H + +void Attendre(unsigned int millisecondes); +void Afficher_Temps(int minutes, int secondes, char texte[]); +void Afficher_Score(int score, char texte[]); + +#endif /* TEMPS_SCORE_H */ diff --git a/temps_score.o b/temps_et_score.o similarity index 64% rename from temps_score.o rename to temps_et_score.o index 237b71e..f18bcb7 100644 Binary files a/temps_score.o and b/temps_et_score.o differ diff --git a/terrain.h b/terrain.h index db5498d..109cc6e 100644 --- a/terrain.h +++ b/terrain.h @@ -1,5 +1,5 @@ -#ifndef MENU_TERRAIN_H -#define MENU_TERRAIN_H +#ifndef TERRAIN_H +#define TERRAIN_H void Terrain(); void Contoure_Terrain(); @@ -15,4 +15,4 @@ void Perdu(char *texte, int score, int minutes, int secondes, int* rejouer); #define CONTOURE_H 2 #define CONTOURE_L 5 -#endif /* MENU_TERRAIN_H */ +#endif /* TERRAIN_H */ diff --git a/terrain.h~ b/terrain.h~ index e69de29..db5498d 100644 --- a/terrain.h~ +++ b/terrain.h~ @@ -0,0 +1,18 @@ +#ifndef MENU_TERRAIN_H +#define MENU_TERRAIN_H + +void Terrain(); +void Contoure_Terrain(); +void Start(int* jouer); +void Pause(char* texte, int minutes, int secondes, int score, int* continuer); +void Perdu(char *texte, int score, int minutes, int secondes, int* rejouer); + +#define LARGEUR_FENETRE 1050 +#define HAUTEUR_FENETRE 750 +#define TAILLE_CASE 15 +#define COLONNES 60 +#define LIGNES 40 +#define CONTOURE_H 2 +#define CONTOURE_L 5 + +#endif /* MENU_TERRAIN_H */ diff --git a/menu_terrain.o b/terrain.o similarity index 83% rename from menu_terrain.o rename to terrain.o index 6143d7d..edc90bc 100644 Binary files a/menu_terrain.o and b/terrain.o differ