From 09bd7cbf29cef082a3d660a05b1ce0fc9c345672 Mon Sep 17 00:00:00 2001 From: belkhiritaha <belkhiri.taha53@gmail.com> Date: Thu, 23 Jun 2022 14:29:43 +0200 Subject: [PATCH] changement UPDATETIME --- travail_de_groupe/chef_oeuvre/src/fire.h | 2 +- travail_de_groupe/chef_oeuvre/src/render.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/travail_de_groupe/chef_oeuvre/src/fire.h b/travail_de_groupe/chef_oeuvre/src/fire.h index 10ea4c3..3b9f991 100644 --- a/travail_de_groupe/chef_oeuvre/src/fire.h +++ b/travail_de_groupe/chef_oeuvre/src/fire.h @@ -13,7 +13,7 @@ #define STRONG 3 #define SPREAD 4 -#define UPDATETIME 5 +#define UPDATETIME 10 typedef struct fire{ diff --git a/travail_de_groupe/chef_oeuvre/src/render.c b/travail_de_groupe/chef_oeuvre/src/render.c index 2c3a2ad..b633e43 100644 --- a/travail_de_groupe/chef_oeuvre/src/render.c +++ b/travail_de_groupe/chef_oeuvre/src/render.c @@ -285,8 +285,8 @@ void drawTime(){ SDL_RenderCopy(renderer, scoreTexture, NULL, &rect); rect.y += rect.h; char str[10]; - printf("%d\n", (UPDATETIME * 2000 - (int)timer % (UPDATETIME * 2000))/1000); - sprintf(str, "%d", (UPDATETIME * 2000 - (int)timer % (UPDATETIME * 2000))/1000); + printf("%d\n", (UPDATETIME * 1000 - (int)timer % (UPDATETIME * 1000))/1000); + sprintf(str, "%d", (UPDATETIME * 1000 - (int)timer % (UPDATETIME * 1000))/1000); SDL_Color textColor = {237,222,17}; SDL_Surface * surface = TTF_RenderText_Solid(robotoFont, str, textColor); SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, surface); @@ -393,7 +393,7 @@ void mainLoop(){ drawMenu(); break; case GAME: - if ((int)timer % (UPDATETIME * 2000) < 10){ + if ((int)timer % (UPDATETIME * 1000) < 10){ nextFire(fireList); fireList=spreadFire(fireList); } -- GitLab