ajout de la fonction de manger des pommes

This commit is contained in:
2023-12-17 04:09:38 +01:00
parent ec6bc5987d
commit cc1e72bee9
8 changed files with 165 additions and 97 deletions

View File

@@ -6,15 +6,16 @@
#include <stdlib.h>
#include <graph.h>
#include "plateau_init.h"
#include "fenetre.h"
int start (struct adresse* pointeur) {
void start (struct adresse* pointeur) {
couleur green, grey, yellow, red, black, white;
int** tableau = pointeur -> plateau;
int** plateau = pointeur -> plateau;
int i, j;
@@ -86,14 +87,14 @@ int start (struct adresse* pointeur) {
for (i = 0; i < LIGNES; i++) {
for (j = 0; j < COLONNES; j++) {
if ( tableau[i][j] == 0) {
if ( plateau[i][j] == 0) {
green = CouleurParComposante(50,205,50);
ChoisirCouleurDessin(green);
RemplirRectangle(20*(j+1),20*(i+1),20,20);
}
if ( tableau[i][j] == 1) {
if ( plateau[i][j] == 1) {
yellow = CouleurParComposante(255,255,0);
ChoisirCouleurDessin(yellow);
@@ -101,7 +102,7 @@ int start (struct adresse* pointeur) {
}
if ( tableau[i][j] == 2) {
if ( plateau[i][j] == 2) {
red = CouleurParComposante(255,0,0);
ChoisirCouleurDessin(red);
@@ -114,23 +115,6 @@ int start (struct adresse* pointeur) {
/* déallocation du tableau */
for ( i = 0; i < LIGNES; i++) {
free(tableau[i]);
}
free(tableau);
return EXIT_SUCCESS;
}