maj
This commit is contained in:
commit
81aa9fae9b
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
@ -12,7 +12,7 @@ OFILES = plateau_init.o \
|
|||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
CFLAGS = -ansi -pedantic -lgraph -I/usr/local/include
|
CFLAGS = -ansi -pedantic -lgraph
|
||||||
|
|
||||||
### REGLES ESSENTIELLES ###
|
### REGLES ESSENTIELLES ###
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ run : $(OFILES)
|
|||||||
### NETTOYAGE DES FICHIERS GENERES ###
|
### NETTOYAGE DES FICHIERS GENERES ###
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
-rm -f $(OFILES) lancement *~
|
-rm -f $(OFILES) lancement *~ a.out
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,12 +10,34 @@
|
|||||||
#include "update_queue.h"
|
#include "update_queue.h"
|
||||||
|
|
||||||
|
|
||||||
int** deplacement(int* p) {
|
int** deplacement(int* p, int timer) {
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
int* tete = NULL, queue = NULL;
|
int* tete = NULL, queue = NULL;
|
||||||
|
|
||||||
|
char sens;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* avancement du serpent */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* alloacation des tableau tete et queue qui prendront les coordonnées de la tête et la queue */
|
/* alloacation des tableau tete et queue qui prendront les coordonnées de la tête et la queue */
|
||||||
|
|
||||||
tete = malloc(2*sizeof(short int));
|
tete = malloc(2*sizeof(short int));
|
||||||
|
@ -17,6 +17,7 @@ int start (void) {
|
|||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
char* texte1 = "espace = lancer";
|
char* texte1 = "espace = lancer";
|
||||||
|
|
||||||
@ -34,6 +35,8 @@ int start (void) {
|
|||||||
/*initialisation de la taille de la fenetre de jeux*/
|
/*initialisation de la taille de la fenetre de jeux*/
|
||||||
|
|
||||||
CreerFenetre(10,10,1450,840);
|
CreerFenetre(10,10,1450,840);
|
||||||
|
=======
|
||||||
|
>>>>>>> 34ff1f1297db1e53f89c782b8688b2232eaddd6f
|
||||||
|
|
||||||
|
|
||||||
/* remplisage du fond d'écran */
|
/* remplisage du fond d'écran */
|
||||||
@ -130,11 +133,7 @@ int start (void) {
|
|||||||
free(tableau);
|
free(tableau);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Touche();
|
|
||||||
FermerGraphique();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
16
snake/main.c
16
snake/main.c
@ -2,13 +2,29 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "fenetre.h"
|
#include "fenetre.h"
|
||||||
#include "plateau_init.h"
|
#include "plateau_init.h"
|
||||||
|
#include <graph.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
|
|
||||||
|
InitialiserGraphique();
|
||||||
|
|
||||||
|
/*initialisation de la taille de la fenetre de jeux*/
|
||||||
|
|
||||||
|
CreerFenetre(10,10,1450,840);
|
||||||
|
|
||||||
|
|
||||||
start();
|
start();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Touche();
|
||||||
|
FermerGraphique();
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
50
snake/time.c
50
snake/time.c
@ -1,34 +1,54 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <graph.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <maj_fenetre.h>
|
#include <graph.h>
|
||||||
|
|
||||||
|
|
||||||
|
#define CYCLE 1000000L
|
||||||
#define CYCLE 10000L
|
|
||||||
|
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
|
|
||||||
|
unsigned long suivant;
|
||||||
|
|
||||||
suivant= Microsecondes()+CYCLE;
|
unsigned int secondes = 0, minutes = 0;
|
||||||
|
|
||||||
|
suivant = Microsecondes() + CYCLE;
|
||||||
|
|
||||||
while (1!=0){
|
printf("%d : %d\n", minutes, secondes);
|
||||||
|
|
||||||
if (Microsecondes()>suivant){
|
while (1) {
|
||||||
|
|
||||||
|
if (Microsecondes() > suivant) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* une periode s'est écoulé */
|
||||||
|
/* prochaine date */
|
||||||
|
|
||||||
/* une periode s'est écoulé */
|
suivant = Microsecondes()+CYCLE;
|
||||||
/* prochaine date */
|
|
||||||
|
|
||||||
suivant= Microsecondes()+CYCLE;
|
secondes++;
|
||||||
}
|
|
||||||
|
if ( secondes == 60) {
|
||||||
|
|
||||||
|
secondes = 0;
|
||||||
|
|
||||||
|
minutes ++;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%d : %d\n", minutes,secondes);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user