HelpSave Highscore

Posts 16 of 6 · Page 1 of 1
Save Highscore
Hey Guys,

does anyone of you have a good Idea how I can make a better Highscore-System for my released Game?
For now I am using a txt-file with one highscore
Code:
 Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
        TextBox1.Text = System.I0.File.ReadAllText("Highscore.txt")
        If Val(TextBox1.Text) < Label6.Text Then
            Using Highscore As New System.I0.StreamWriter("Highscore.txt")
                Highscore.WriteLine(Label6.Text)
                Highscore.Flush()
                MsgBox("New Highscore")
            End Using
        End If
    End Sub
I want to make a highscore-list with 10 highscores and maybe names. It also shouldnt be that easy to hack it.
I hope you can help me

SMDUCK
Save thescore in the settings in my.settings
As integer and roaming=true
Save it in your settings.
Make a new one type System.Collection.Specialized.StringCollection

That is a setting that you can save strings like a collection or a listbox control.

To add something in it,
Code:
Dim strings(My.Settings.List1.Count - 1) As String
My.Settings.List1Save.CopyTo(strings, 0)
'And a function to add into it. Such as,
ListBox1.Items.AddRange(strings)
I think you can do something with that.
It's more easy :\

Code:
dim score as integer = textbox1.value
If score <= My.settings.Highscore then
'Nothing
else
My.settings.highscore = score
You're right. Yours is easier, but it saves only one score.
Thanks to both of you. I'll use dawgy's way.
/solved
Posts 16 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?