ajout commentaires plus fonctions graph.h manquantes

This commit is contained in:
JUDE CHRIST AISSI 2023-12-22 15:28:39 +01:00
parent 85409dab44
commit e6e209067f
6 changed files with 31 additions and 9 deletions

Binary file not shown.

View File

@ -1,5 +1,7 @@
#include <graph.h> #include <graph.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdlib.h>
#include "../fichier.h/Oeuf.h" #include "../fichier.h/Oeuf.h"
#include "../fichier.h/time.h" #include "../fichier.h/time.h"

View File

@ -2,45 +2,55 @@
#include <stdio.h> #include <stdio.h>
#include <graph.h> #include <graph.h>
#include <time.h> #include <time.h>
#include "../fichier.h/serpent.h" #include "../fichier.h/serpent.h"
#include "../fichier.h/Oeuf.h" #include "../fichier.h/Oeuf.h"
#include "../fichier.h/time.h" #include "../fichier.h/time.h"
#include "../fichier.h/main.h" #include "../fichier.h/main.h"
#include "../fichier.h/menu.h" #include "../fichier.h/menu.h"
#define CYCLE 100000L #define CYCLE 100000L
#define DELAI_MILLISECONDES 100 #define DELAI_MILLISECONDES 100
void attente(int milliseconds) { void attente(int milliseconds) {
clock_t start_time = clock(); clock_t start_time = clock();
while ((clock() - start_time) * 1000 / CLOCKS_PER_SEC < milliseconds) { while ((clock() - start_time) * 1000 / CLOCKS_PER_SEC < milliseconds) {
} }
} }
int lancer_jeu(){ int lancer_jeu(){
/*Variable jeu*/
int go_on=1; int go_on=1;
int pause = 1; int pause = 1;
/*Variable Serpent*/
int segment = 10; int segment = 10;
int direction = 4; int direction = 4;
int minute = 0;
int seconde = 0;
int seconde_actuel = 0;
int old_seconde = 0;
unsigned long int suivant;
int pos_x[2400]; int pos_x[2400];
int pos_y[2400]; int pos_y[2400];
int old_x[2400]; int old_x[2400];
int old_y[2400]; int old_y[2400];
/*Variable pour le temps*/
int minute = 0;
int seconde = 0;
int seconde_actuel = 0;
int old_seconde = 0;
char timer[6];
unsigned long int suivant;
/*Variable Oeufs*/
int oeufx[5]; int oeufx[5];
int oeufy[5]; int oeufy[5];
/*Variable Murs*/
int murx[30]; int murx[30];
int mury[30]; int mury[30];
char timer[6]; /*Pointeur */
int *pointeur_segment = &segment; int *pointeur_segment = &segment;
int *pointeur_direction = &direction; int *pointeur_direction = &direction;
int *pointeur_minute = &minute; int *pointeur_minute = &minute;
int *pointeur_seconde = &seconde; int *pointeur_seconde = &seconde;
unsigned long int *pointeur_suivant = &suivant;
int *pointeur_seconde_actuel = &seconde_actuel; int *pointeur_seconde_actuel = &seconde_actuel;
int *pointeur_old_seconde = &old_seconde; int *pointeur_old_seconde = &old_seconde;
int *pointeur_pause = &pause; int *pointeur_pause = &pause;
unsigned long int *pointeur_suivant = &suivant;
suivant = Microsecondes()+CYCLE; suivant = Microsecondes()+CYCLE;
old_seconde=(suivant/1000000)%10; old_seconde=(suivant/1000000)%10;
Scene(murx, mury, minute, seconde ,timer); Scene(murx, mury, minute, seconde ,timer);

View File

@ -1,8 +1,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <graph.h>
#include <stdio.h> #include <stdio.h>
#include <graph.h>
#include "../fichier.h/main.h" #include "../fichier.h/main.h"
#include "../fichier.h/time.h" #include "../fichier.h/time.h"
void Menu_debut(void) { void Menu_debut(void) {
int af = ChargerSprite("img/image.jpg"); int af = ChargerSprite("img/image.jpg");
AfficherSprite(af, 0, 0); AfficherSprite(af, 0, 0);

View File

@ -1,3 +1,7 @@
#include <graph.h>
#include <stdlib.h>
#include <stdio.h>
#include <graph.h> #include <graph.h>
#include "../fichier.h/serpent.h" #include "../fichier.h/serpent.h"
#include "../fichier.h/main.h" #include "../fichier.h/main.h"

View File

@ -1,7 +1,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <graph.h> #include <graph.h>
#include <time.h> #include <time.h>
#include <graph.h>
#include "../fichier.h/time.h" #include "../fichier.h/time.h"
#include "../fichier.h/terrain.h" #include "../fichier.h/terrain.h"
#include "../fichier.h/serpent.h" #include "../fichier.h/serpent.h"