I have a high score table in my game. However, when I try to insert a score into the table, although it appears in correct place, and the scores above are right, any that follow are not right can anyone see where I have gone wrong?
I know it's to do with this section:
but I can't see how to correct it - (I gess it's the heat :) )
position=0 For f=10 To 1 Step-1 number=(hiscoredata$(f,2)) If score>number position=f EndIf Next If position>0 For f=(position) To 9 hiscoredata$(f,1)=hiscoredata$(f+1,1) hiscoredata$(f,2)=hiscoredata$(f+1,2) Next hiscoredata$(position,1)=name$ hiscoredata$(position,2)=score ffile=WriteFile("HSTable.SCO") For f=1 To 10 WriteLine ffile,hiscoredata$(f,1) WriteLine ffile,hiscoredata$(f,2) Next EndIf
I know it's to do with this section:
If position>0 For f=(position) To 9 hiscoredata$(f,1)=hiscoredata$(f+1,1) hiscoredata$(f,2)=hiscoredata$(f+1,2) Next hiscoredata$(position,1)=name$ hiscoredata$(position,2)=score
but I can't see how to correct it - (I gess it's the heat :) )