score initial fini
This commit is contained in:
parent
6e958b9548
commit
cfdadc35e1
@ -4,6 +4,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <graph.h>
|
||||
#include <stdio.h>
|
||||
#include "ajout_score.h"
|
||||
|
||||
|
||||
/*int main(unsigned int compteur) {
|
||||
@ -44,25 +45,12 @@ void ajout_score(int* compteur) {
|
||||
|
||||
sprintf(a, "%d", *compteur);
|
||||
|
||||
InitialiserGraphique();
|
||||
CreerFenetre(10,10,1450,840);
|
||||
|
||||
RemplirRectangle( 1241, 600, 195, 80);
|
||||
|
||||
EcrireTexte(1250, 600, a, 2);
|
||||
|
||||
Touche();
|
||||
FermerGraphique();
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
|
||||
int *compteur = NULL;
|
||||
compteur = malloc(sizeof(int));
|
||||
*compteur = 0;
|
||||
ajout_score(compteur);
|
||||
free(compteur);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
15
snake/ajout_score.h
Normal file
15
snake/ajout_score.h
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef AJOUT_SCORE_H
|
||||
#define AJOUT_SCORE_H
|
||||
|
||||
|
||||
void ajout_score(int* compteur);
|
||||
|
||||
|
||||
#endif /* AJOUT_SCORE_H */
|
BIN
snake/lancement
Executable file
BIN
snake/lancement
Executable file
Binary file not shown.
@ -14,6 +14,8 @@ int main(void) {
|
||||
struct adresse* pointeur = plateau_init();
|
||||
|
||||
|
||||
|
||||
|
||||
InitialiserGraphique();
|
||||
|
||||
/*initialisation de la taille de la fenetre de jeux*/
|
||||
@ -34,6 +36,10 @@ int main(void) {
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Touche();
|
||||
FermerGraphique();
|
||||
|
||||
|
20
snake/score_init.c
Normal file
20
snake/score_init.c
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <graph.h>
|
||||
#include <stdio.h>
|
||||
#include "score_init.h"
|
||||
|
||||
|
||||
|
||||
void score_init(int* compteur) {
|
||||
|
||||
int *compteur = NULL;
|
||||
compteur = malloc(sizeof(int));
|
||||
*compteur = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
free(compteur);
|
||||
}
|
9
snake/score_init.h
Normal file
9
snake/score_init.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef SCORE_INIT_H
|
||||
#define SCORE_INIT_H
|
||||
|
||||
|
||||
void score_init (int* compteur);
|
||||
|
||||
|
||||
#endif /* SCORE_INIT_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user