Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.30 KB | None | 0 0
  1. case REGCHAR: if(move_input == 'q'|| move_input == 'Q'){ //for quit  
  2.                               state = EXIT;}
  3.                             else if(move_input == 'p'|| move_input == 'P'){ //for pause        
  4.                               while(1){
  5.                                 char pause = getch();
  6.                                 if(pause == 'p' || pause == 'P'){
  7.                                   break;
  8.                                 }
  9.                               }
  10.                             }else if(move_input == 's' || move_input == 'S'){//for save        
  11.                               FILE *saveFile;
  12.                               saveFile = fopen("./saves/save_0.game", "w");
  13.                               //fputc(score, saveFile);                                        
  14.                               //fputc(health, saveFile);                                        
  15.                               int i, j;
  16.                               for(i=0; i++; i<100){
  17.                                 for(j=0; j++; j<100){
  18.                                   fprintf(saveFile, "%d", tiles[i][j]->state[CURRENT]);
  19.                                 }
  20.                                }
  21.                               fclose(saveFile);
  22.                                save_counter++;
  23.                             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement