Ajout des travaux effectuer
This commit is contained in:
49
23DEV1.1/SAE/1-SAE/Snake.c
Normal file
49
23DEV1.1/SAE/1-SAE/Snake.c
Normal file
@@ -0,0 +1,49 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <graph.h>
|
||||
#include <time.h>
|
||||
|
||||
void graphique(){
|
||||
int point = 0;
|
||||
int n = 0;
|
||||
InitialiserGraphique();
|
||||
CreerFenetre(1700,950,1700,950);
|
||||
couleur c, r, e;
|
||||
r=CouleurParComposante(0,0,0);
|
||||
ChoisirCouleurDessin(r);
|
||||
RemplirRectangle(0,0,1700,950);
|
||||
c=CouleurParComposante(111,255,94);
|
||||
ChoisirCouleurDessin(c);
|
||||
RemplirRectangle(17,20,1670,850);
|
||||
temps(n);
|
||||
Touche();
|
||||
FermerGraphique();
|
||||
}
|
||||
//1 = pomme ; 2 = mur ; 3 = corps du serpent
|
||||
//deplacement du serpent
|
||||
//detection des obstacles
|
||||
//temps de jeu
|
||||
//score du jeu
|
||||
int score(int ab){
|
||||
ab++;
|
||||
return ab;
|
||||
}
|
||||
|
||||
void temps(int n){
|
||||
couleur f;
|
||||
unsigned long suivant;
|
||||
char buf[100];
|
||||
while(1){
|
||||
if (Microsecondes()>suivant){
|
||||
n++;
|
||||
f=CouleurParNom("white");
|
||||
ChoisirCouleurDessin(f);
|
||||
snprintf(buf,100,"Temps : %05d", n);
|
||||
}
|
||||
}
|
||||
}
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
graphique();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user