Skip to content
Snippets Groups Projects
Commit 6d64db04 authored by belkhiritaha's avatar belkhiritaha
Browse files

fix clock

parent 5215b4ad
No related branches found
No related tags found
No related merge requests found
......@@ -55,10 +55,6 @@ listchainfire_t startFire(listchainfire_t listFire,int numberFire, int mapSize){
xFire= rand()%mapSize;
yFire= rand()%mapSize;
<<<<<<< HEAD
//printf("xf:%d,yf:%d\n",xFire,yFire);
=======
>>>>>>> 91e99d9a0e864cf399133d4e59d4d7951d1bbd0a
fire.x= xFire;
fire.y= yFire;
fire.state=1;
......
......@@ -285,7 +285,8 @@ void drawTime(){
SDL_RenderCopy(renderer, scoreTexture, NULL, &rect);
rect.y += rect.h;
char str[10];
sprintf(str, "%d", UPDATETIME - (int)timer/1000 % UPDATETIME);
printf("%d\n", (UPDATETIME * 2000 - (int)timer % (UPDATETIME * 2000))/1000);
sprintf(str, "%d", (UPDATETIME * 2000 - (int)timer % (UPDATETIME * 2000))/1000);
SDL_Color textColor = {237,222,17};
SDL_Surface * surface = TTF_RenderText_Solid(robotoFont, str, textColor);
SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, surface);
......@@ -385,17 +386,14 @@ void mainLoop(){
delta = (a - b);
if (delta > 1000/FPS_TO_GET){
timer += delta;
printf("%d\n", (int)timer % 1000);
b = a;
<<<<<<< HEAD
//printf("fps : %f", 1000/delta);
=======
>>>>>>> 91e99d9a0e864cf399133d4e59d4d7951d1bbd0a
switch (gameState){
case MENU:
drawMenu();
break;
case GAME:
if ((int)timer % 100 == 0){
if ((int)timer % (UPDATETIME * 2000) < 10){
nextFire(fireList);
fireList=spreadFire(fireList);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment