-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateScore()
More file actions
43 lines (31 loc) · 1.07 KB
/
Copy pathupdateScore()
File metadata and controls
43 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
void updateScore()
{
FILE *fp;
fp=fopen("F:\DX Ball\Score.txt","r");
if(fp==NULL){
printf("No file..");
return ;
}
fscanf(fp,"%d %[^\n]",&high_scorei,temp_arr);
if(score>high_scorei)
{
high_scorei=score;
strcpy(temp_arr,str2);
//iSetColor(0,0,0);
//iText(250,600,str2,GLUT_BITMAP_TIMES_ROMAN_24);
//iText(350,600,update,GLUT_BITMAP_TIMES_ROMAN_24);
}
fclose(fp);
FILE *fptr;
fptr=fopen("F:\DX Ball\Score.txt","w");
fprintf(fptr,"%d %s",high_scorei,temp_arr);
///sprintf(high_score," %d ",high_scorei);
///iSetColor(0,0,0);
///iText(250,600,temp_arr,GLUT_BITMAP_TIMES_ROMAN_24);
///iText(350,600,high_score,GLUT_BITMAP_TIMES_ROMAN_24);
fclose(fptr);
FILE *f;
f=fopen("F:\DX Ball\Score.txt","r");
fscanf(f,"%d %s",&high_scorei,temp_arr);
fclose(f);
}