プレイ日記
nate NJR1432
How do you save a high score in a game? I want to know for my crashieplane game. Please answer! :D
4そうだね
プレイ済み
返信[1]
親投稿
Ed CPFace
Simplest way to save and load: SAVE "TXT:HIGHSCORE",STR$(HIGHSCORE) HIGHSCORE=VAL(LOAD("TXT:HIGHSCORE"))
1そうだね
プレイ済み
返信[2]
親投稿
V360 TheV360
Another, this time using DAT files: VAR SAVE%[1] ...later, when you want to save SAVE%[0]=SCORE_VAR_HERE% SAVE "DAT:HIGHSCORE",SAVE%
1そうだね
プレイ済み
返信[3]
親投稿
nate NJR1432
Thanks, but how do i make it not save every single time if i get more than 0? here is the code i used.
0そうだね
プレイ済み
返信[4]
親投稿
V360 TheV360
If you want to hide the "Load successful" dialog, then change line 292 to HIGHSCORE=VAL(LOAD("TXT:HIGHSCORE",0))
0そうだね
プレイ済み
返信[5]
親投稿
Ed CPFace
S is your score, right? If S is higher than the previous high score, you should be saving S, not the previous high score: IF S>HIGHSCORE THEN SAVE "TXT:HIGHSCORE",STR$(S)
2そうだね
プレイ済み
返信[6]
親投稿
nate NJR1432
Is this the right code? if it is it just saves whenever i get more than 0
0そうだね
プレイ済み
返信[7]
親投稿
nate NJR1432
nevermind figured it out! Thanks Ed and V360! :D
1そうだね
プレイ済み