Améliration Graphique ( non fini ) + code plus facile a lire

This commit is contained in:
2023-12-21 14:32:55 +01:00
parent 114f3dbb39
commit 887caed239
10 changed files with 217 additions and 128 deletions

View File

@@ -3,7 +3,8 @@
#include <stdlib.h>
#include <time.h>
#include "main.h"
#include "GUI.h"
#include "gui.h"
#include "scene.h"
void AfficherTimerEtScore(long unsigned int *score, int minutes,int secondes) /*Afficher le temps passé et le score*/
{
@@ -25,17 +26,6 @@ void AfficherTimerEtScore(long unsigned int *score, int minutes,int secondes)
CopierZone(1,0,0,0,930,710,0,0);
}
void InitialiserPastilles(PIXELS *pastilles, PIXELS *serpent, int longueur_serpent) {
int i;
srand(time(NULL));
for (i = 0; i < PASTILLES; i++) {
pastilles[i] = gen_pastille(serpent,pastilles,longueur_serpent);
ChargerImage("./images/PommePastille.png",pastilles[i].x,pastilles[i].y,0,0,T_PIXEL,T_PIXEL);
}
}
int MourrirSerpent(PIXELS *serpent, int longueur_serpent)
{
int i = 0;
@@ -94,7 +84,6 @@ void DeplacementSerpent(int direction ,PIXELS *serpent, int longueur)
tempY = tempY2;
}
if(direction == 0) /* Direction vers la gauche */
{
serpent[0].x-=T_PIXEL;
@@ -117,7 +106,7 @@ void DeplacementSerpent(int direction ,PIXELS *serpent, int longueur)
}
}
int Serpent(PIXELS *serpent,PIXELS *pastilles,unsigned long *score,int *longueur_serpent,unsigned long int *vitesse,int direction)
int Serpent(PIXELS *serpent,PIXELS *pastilles,unsigned long *score,unsigned long *longueur_serpent,unsigned long int *vitesse,int direction)
{
if(MourrirSerpent(serpent,*longueur_serpent) == 1)
{