diff --git a/travail_de_groupe/chef_oeuvre/src/fire.h b/travail_de_groupe/chef_oeuvre/src/fire.h index 975fb32c8b02dcf758c617e56c8c41c763961fc3..84686a86881bd2a07895aea29ca00e907e8b387a 100644 --- a/travail_de_groupe/chef_oeuvre/src/fire.h +++ b/travail_de_groupe/chef_oeuvre/src/fire.h @@ -13,6 +13,7 @@ #define STRONG 3 #define SPREAD 4 +#define UPDATETIME 5 typedef struct fire{ diff --git a/travail_de_groupe/chef_oeuvre/src/render.c b/travail_de_groupe/chef_oeuvre/src/render.c index 93ec722c0398dd269086a3f7e79a0928194cdca4..0bbc72f5f10752d7424c5052cff8b56488472908 100644 --- a/travail_de_groupe/chef_oeuvre/src/render.c +++ b/travail_de_groupe/chef_oeuvre/src/render.c @@ -266,7 +266,7 @@ void drawTime(){ SDL_RenderCopy(renderer, scoreTexture, NULL, &rect); rect.y += rect.h; char str[10]; - sprintf(str, "%d", (int)timer/1000); + sprintf(str, "%d", UPDATETIME - (int)timer/1000 % UPDATETIME); SDL_Color textColor = {237,222,17}; SDL_Surface * surface = TTF_RenderText_Solid(robotoFont, str, textColor); SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, surface); @@ -373,7 +373,7 @@ void mainLoop(){ drawMenu(); break; case GAME: - if ((int)timer/1000 % 5 == 0){ + if ((int)timer/1000 % UPDATETIME == 0){ nextFire(fireList); } drawGame();