suppression fichier inutile
This commit is contained in:
parent
03457ec701
commit
10a46fd82b
18
GUI.c
18
GUI.c
@ -1,18 +0,0 @@
|
|||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <graph.h>
|
|
||||||
|
|
||||||
int Menu()
|
|
||||||
{
|
|
||||||
ChargerImage("./images/Menu.png",0,0,0,0,930,710);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Pause()
|
|
||||||
{
|
|
||||||
ChargerImage("./images/Pause.png",0,0,0,0,930,710);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Reinitialiser()
|
|
||||||
{
|
|
||||||
CopierZone(8,0,0,0,930,710,0,0);
|
|
||||||
}
|
|
8
GUI.h
8
GUI.h
@ -1,8 +0,0 @@
|
|||||||
#ifndef GUI_H
|
|
||||||
#define GUI_H
|
|
||||||
|
|
||||||
void Pause();
|
|
||||||
void Reinitialiser();
|
|
||||||
int AfficherGUI(unsigned char menu);
|
|
||||||
|
|
||||||
#endif
|
|
129
evenement.c
129
evenement.c
@ -1,129 +0,0 @@
|
|||||||
#include <graph.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include "main.h"
|
|
||||||
#include "gui.h"
|
|
||||||
#include "scene.h"
|
|
||||||
|
|
||||||
void AfficherTimerEtScore(long unsigned int *score, int minutes,int secondes) /*Afficher le temps passé et le score*/
|
|
||||||
{
|
|
||||||
char buf[100];
|
|
||||||
char buff[100]; /* Stockage du score et du timer */
|
|
||||||
couleur text;
|
|
||||||
text=CouleurParComposante(78, 93, 47);
|
|
||||||
|
|
||||||
ChoisirEcran(1);
|
|
||||||
CopierZone(2,1,0,0,930,710,0,0);
|
|
||||||
|
|
||||||
ChoisirCouleurDessin(text);
|
|
||||||
|
|
||||||
snprintf(buf,100,"TEMPS : %02d:%02d",minutes,secondes);
|
|
||||||
snprintf(buff,100,"SCORE : %07ld",*score);
|
|
||||||
EcrireTexte(60,695,buf,2);
|
|
||||||
EcrireTexte(600,695,buff,2);
|
|
||||||
|
|
||||||
CopierZone(1,0,0,0,930,710,0,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int MourrirSerpent(PIXELS *serpent,PIXELS *obstacle, unsigned long longueur_serpent,unsigned long longueur_obstacle)
|
|
||||||
{
|
|
||||||
unsigned long i = 0;
|
|
||||||
for(i=1;i<longueur_serpent;i++)
|
|
||||||
{
|
|
||||||
if(serpent[0].x == serpent[i].x && serpent[0].y == serpent[i].y )
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(i=1;i<longueur_obstacle;i++)
|
|
||||||
{
|
|
||||||
if(serpent[0].x == obstacle[i].x && serpent[0].y == obstacle[i].y )
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (serpent[0].x<=0 || serpent[0].x>W_GAME || serpent[0].y<=0 || serpent[0].y>H_GAME)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int MangerPastille(PIXELS *serpent, PIXELS* pastilles,PIXELS *obstacle,unsigned long *score,unsigned long longueur_serpent,unsigned long longueur_obstacle,unsigned long int *vitesse)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
for(i=0;i<PASTILLES;i++)
|
|
||||||
{
|
|
||||||
if(serpent[0].x == pastilles[i].x && serpent[0].y == pastilles[i].y)
|
|
||||||
{
|
|
||||||
pastilles[i] = gen_pastille(serpent,pastilles,obstacle,longueur_serpent,longueur_obstacle);
|
|
||||||
ChargerImage("./images/PommePastille.png",pastilles[i].x,pastilles[i].y,0,0,T_PIXEL,T_PIXEL);
|
|
||||||
*score+=5;
|
|
||||||
*vitesse/=1.008;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DeplacementSerpent(int direction ,PIXELS *serpent, unsigned long longueur)
|
|
||||||
{
|
|
||||||
int tempX = serpent[0].x;
|
|
||||||
int tempY = serpent[0].y;
|
|
||||||
unsigned long i;
|
|
||||||
couleur bg;
|
|
||||||
ChoisirEcran(2);
|
|
||||||
bg=CouleurParComposante(171, 204, 104);
|
|
||||||
ChoisirCouleurDessin(bg);
|
|
||||||
|
|
||||||
RemplirRectangle(serpent[longueur-1].x,serpent[longueur-1].y,T_PIXEL,T_PIXEL);
|
|
||||||
|
|
||||||
for (i = 1; i <= longueur; i++)
|
|
||||||
{
|
|
||||||
int tempX2 = serpent[i].x;
|
|
||||||
int tempY2 = serpent[i].y;
|
|
||||||
|
|
||||||
serpent[i].x = tempX;
|
|
||||||
serpent[i].y = tempY;
|
|
||||||
|
|
||||||
tempX = tempX2;
|
|
||||||
tempY = tempY2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(direction == 0) /* Direction vers la gauche */
|
|
||||||
{
|
|
||||||
serpent[0].x-=T_PIXEL;
|
|
||||||
ChargerImage("./images/SnakePart.png",serpent[0].x,serpent[0].y,0,0,T_PIXEL,T_PIXEL);
|
|
||||||
}
|
|
||||||
else if(direction == 1) /* Direction vers le haut */
|
|
||||||
{
|
|
||||||
serpent[0].y-=T_PIXEL;
|
|
||||||
ChargerImage("./images/SnakePart.png",serpent[0].x,serpent[0].y,0,0,T_PIXEL,T_PIXEL);
|
|
||||||
}
|
|
||||||
else if(direction == 2) /* Direction vers la droite */
|
|
||||||
{
|
|
||||||
serpent[0].x+=T_PIXEL;
|
|
||||||
ChargerImage("./images/SnakePart.png",serpent[0].x,serpent[0].y,0,0,T_PIXEL,T_PIXEL);
|
|
||||||
}
|
|
||||||
else if(direction == 3) /* Direction vers le bas */
|
|
||||||
{
|
|
||||||
serpent[0].y+=T_PIXEL;
|
|
||||||
ChargerImage("./images/SnakePart.png",serpent[0].x,serpent[0].y,0,0,T_PIXEL,T_PIXEL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int Serpent(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,unsigned long *score,unsigned long *longueur_serpent,unsigned long longueur_obstacle,unsigned long int *vitesse,int direction)
|
|
||||||
{
|
|
||||||
if(MourrirSerpent(serpent,obstacle,*longueur_serpent,longueur_obstacle) == 1)
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
DeplacementSerpent(direction,serpent,*longueur_serpent);
|
|
||||||
if(MangerPastille(serpent,pastilles,obstacle,score,*longueur_serpent,longueur_obstacle,vitesse) == 1)
|
|
||||||
{
|
|
||||||
*longueur_serpent+=2;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
19
evenement.h
19
evenement.h
@ -1,19 +0,0 @@
|
|||||||
#include "main.h"
|
|
||||||
|
|
||||||
#ifndef EVENEMENT_H
|
|
||||||
#define EVENEMENT_H
|
|
||||||
|
|
||||||
int MangerPastille(PIXELS *serpent, PIXELS* pastilles,PIXELS *obstacle,unsigned long *score,unsigned long longueur_serpent,unsigned long longueur_obstacle,unsigned long int *vitesse);
|
|
||||||
|
|
||||||
void DeplacementSerpent(int direction ,PIXELS *serpent, unsigned long longueur);
|
|
||||||
|
|
||||||
void AfficherTimerEtScore(long unsigned int *score,int minutes,int secondes);
|
|
||||||
|
|
||||||
int PastilleSurSerpent(PIXELS pastille, PIXELS *serpent, unsigned long longueur_serpent);
|
|
||||||
|
|
||||||
int MourrirSerpent(PIXELS *serpent,PIXELS *obstacle,unsigned long longueur_serpent,unsigned long longueur_obstacle);
|
|
||||||
|
|
||||||
int Serpent(PIXELS *serpent,PIXELS *pastilles,PIXELS *obstacle,unsigned long *score,unsigned long *longueur_serpent,unsigned long longueur_obstacle,unsigned long int *vitesse,int direction);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
BIN
prog
BIN
prog
Binary file not shown.
33
rapport.txt
33
rapport.txt
@ -1,33 +0,0 @@
|
|||||||
#################
|
|
||||||
# 1ere Semaine #
|
|
||||||
#################
|
|
||||||
|
|
||||||
- Ajout de la première interface graphique
|
|
||||||
- Apparition des pastilles et leur génération
|
|
||||||
- Ajout de la boucle d'évenement
|
|
||||||
|
|
||||||
#################
|
|
||||||
# 2eme Semaine #
|
|
||||||
#################
|
|
||||||
|
|
||||||
- Ajout de l'initialisation du Snake
|
|
||||||
- Valeur du Snake stocké dans un tableau non dynamique
|
|
||||||
- Tableau dynamique pour le snake
|
|
||||||
- Ajout du Timer
|
|
||||||
|
|
||||||
#################
|
|
||||||
# 3eme Semaine #
|
|
||||||
#################
|
|
||||||
|
|
||||||
- Ajout Pause
|
|
||||||
- Ajout Timer
|
|
||||||
- Le serpent ne peut maintenant plus ramper sur lui même en martelant les touches
|
|
||||||
- Repartition du code en plusieurs fichiers
|
|
||||||
- Ajout de la struct pixel pour clarifier le code 1/2
|
|
||||||
- Ajout Collision avec les pastilles
|
|
||||||
- Ajout Agrandissement serpent
|
|
||||||
- Ajout du rapport.txt
|
|
||||||
|
|
||||||
#################
|
|
||||||
# 4eme Semaine #
|
|
||||||
#################
|
|
Loading…
x
Reference in New Issue
Block a user