From 5974fb7059071bf16209d5a5714d14d25aebb5a3 Mon Sep 17 00:00:00 2001 From: boutarci Date: Sun, 24 Dec 2023 12:19:00 +0100 Subject: [PATCH] ajout des commentaires --- SAE_semestre1/Makefile | 3 +-- SAE_semestre1/fichier.h/main.h | 1 - SAE_semestre1/snake | Bin 21216 -> 21192 bytes SAE_semestre1/src/Oeuf.c | 2 ++ SAE_semestre1/src/main.c | 2 +- SAE_semestre1/src/menu.c | 1 + SAE_semestre1/src/terrain.c | 1 + bashrc | 0 8 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 bashrc diff --git a/SAE_semestre1/Makefile b/SAE_semestre1/Makefile index b6b8bb2..3e532b9 100755 --- a/SAE_semestre1/Makefile +++ b/SAE_semestre1/Makefile @@ -23,9 +23,8 @@ run : $(EXE) clean : -rm -rf $(ODIR) -# Nouvelle règle pour la dépendance implicite $(EXE): $(ODIR)/a.out -# Nouvelle règle pour construire 'out/a.out' +# construction 'out/a.out' $(ODIR)/a.out: $(OFILES) $(CC) $(CFLAGS) -o $@ $(OFILES) \ No newline at end of file diff --git a/SAE_semestre1/fichier.h/main.h b/SAE_semestre1/fichier.h/main.h index a73dc70..3b4b945 100755 --- a/SAE_semestre1/fichier.h/main.h +++ b/SAE_semestre1/fichier.h/main.h @@ -1,7 +1,6 @@ #ifndef MAIN_H #define MAIN_H - void attente(int milliseconds); int lancer_jeu(void); int main(void); diff --git a/SAE_semestre1/snake b/SAE_semestre1/snake index abcf06dec095d6be9d40f8f48ba23f0b02be2ec8..2d1e0ff1321132b7b82425b230b19f7e64b8db6e 100755 GIT binary patch delta 85 zcmaE`l<~w;#t9mX9vd~|nMKUBRsAlPeU-jjVZ4KDk@oy!PtERbp2KWzJ9!h6?BomH oESq^8zX&i&Pi71Q}&12;VyM?*t8 zASg#pRVg4bGcGYMF(5K9GBYqYF*K900vogNK==>=Hk08%6O;T=BmwY~AyPj9Ad_KI KKLJCNp;9NTQX~HW diff --git a/SAE_semestre1/src/Oeuf.c b/SAE_semestre1/src/Oeuf.c index 69f2941..8870a6b 100755 --- a/SAE_semestre1/src/Oeuf.c +++ b/SAE_semestre1/src/Oeuf.c @@ -8,6 +8,7 @@ void InitialiserOeufs(int oeufx[], int oeufy[], int segment) { int p; int oeuf; + /*Boucles qui initialse 5 pommes aléatoirement*/ for (p = 0; p < 5; p++) { oeufx[p] = ((rand() % (55) + 1) * 20); oeufy[p] = ((rand() % (35) + 1) * 20); @@ -20,6 +21,7 @@ void Oeuf(int old_x[], int old_y[], int oeufx[], int oeufy[], int *segment){ for (p = 0; p < 5; p++) { ChargerImage("img/oeuf.png", oeufx[p], oeufy[p],0,0, 20,20); } + /*Boucles pour vérifiier la colision avec le serpent */ for(p=0; p<5; p++){ if(oeufx[p]==old_x[0] && oeufy[p]==old_y[0]){ (*segment) +=2; diff --git a/SAE_semestre1/src/main.c b/SAE_semestre1/src/main.c index da62b8c..04ee5d9 100644 --- a/SAE_semestre1/src/main.c +++ b/SAE_semestre1/src/main.c @@ -76,7 +76,7 @@ int lancer_jeu(){ Collision_Serpent(pos_x, pos_y, segment, murx, mury, &go_on); attente(DELAI_MILLISECONDES); Oeuf(pos_x, pos_y, oeufx, oeufy, pointeur_segment); - } + } } } diff --git a/SAE_semestre1/src/menu.c b/SAE_semestre1/src/menu.c index 5c59e3b..fda31c5 100755 --- a/SAE_semestre1/src/menu.c +++ b/SAE_semestre1/src/menu.c @@ -14,6 +14,7 @@ void Menu_fin(void){ int fin = ChargerSprite("img/Menu_Fin.jpg"); AfficherSprite(fin, 0,0); } + int Menu(void) { int choix = 1; InitialiserGraphique(); diff --git a/SAE_semestre1/src/terrain.c b/SAE_semestre1/src/terrain.c index 2ed4598..6a59817 100755 --- a/SAE_semestre1/src/terrain.c +++ b/SAE_semestre1/src/terrain.c @@ -19,6 +19,7 @@ void Scene(int murx[], int mury[], int minute, int seconde, char timer []){ RemplirRectangle(20,20,1160,700); ChoisirCouleurDessin(CouleurParComposante(255,255,255)); srand(time(NULL)); + /*Initialisation de 30 obstacles */ for(i=0; i<30; i++){ murx[i] = ((rand() % (55)+1)*20); mury[i] = ((rand() % (35)+1)*20); diff --git a/bashrc b/bashrc deleted file mode 100644 index e69de29..0000000