|
-
Dec 1st, 2011, 05:32 PM
#1
Thread Starter
New Member
leader board help
hi
i am making a game which has a leader board in it. i have written a code for it but it doesn't seem to load it
in a timer(
If lives <= 0 Then
Dim score1 As Integer = CInt(Form2.Label1.Text)
Dim score2 As Integer = CInt(Form2.Label2.Text)
Dim score3 As Integer = CInt(Form2.Label3.Text)
Dim score4 As Integer = CInt(Form2.Label4.Text)
Dim score5 As Integer = CInt(Form2.Label5.Text)
Dim name1 As String = Form2.Label6.Text
Dim name2 As String = Form2.Label7.Text
Dim name3 As String = Form2.Label8.Text
Dim name4 As String = Form2.Label9.Text
Dim name5 As String = Form2.Label10.Text
Form2.Label6.Text = My.Settings.name1
Form2.Label7.Text = My.Settings.name2
Form2.Label8.Text = My.Settings.name3
Form2.Label9.Text = My.Settings.name4
Form2.Label10.Text = My.Settings.name5
Form2.Label1.Text = My.Settings.score1
Form2.Label2.Text = My.Settings.score2
Form2.Label3.Text = My.Settings.score3
Form2.Label4.Text = My.Settings.score4
Form2.Label5.Text = My.Settings.score5
If score > score1 Then
scorename = 1
Form2.Label10.Text = name4
Form2.Label5.Text = score4
Form2.Label9.Text = name3
Form2.Label4.Text = score3
Form2.Label8.Text = name2
Form2.Label3.Text = score2
Form2.Label7.Text = name1
Form2.Label2.Text = score1
Form2.Label6.Text = "-"
Form2.Label1.Text = score
Form5.Show()
Form5.Timer1.Enabled = True
ElseIf score > score2 Or score = score1 Then
scorename = 2
Form2.Label10.Text = name4
Form2.Label5.Text = score4
Form2.Label9.Text = name3
Form2.Label4.Text = score3
Form2.Label8.Text = name2
Form2.Label3.Text = score2
Form2.Label7.Text = "-"
Form2.Label2.Text = score
Form5.Show()
Form5.Timer1.Enabled = True
ElseIf score > score3 Or score = score2 Then
scorename = 3
Form2.Label10.Text = name4
Form2.Label5.Text = score4
Form2.Label9.Text = name3
Form2.Label4.Text = score3
Form2.Label8.Text = "-"
Form2.Label3.Text = score
Form5.Show()
Form5.Timer1.Enabled = True
ElseIf score > score4 Or score = score3 Then
scorename = 4
Form2.Label10.Text = name4
Form2.Label5.Text = score4
Form2.Label8.Text = "-"
Form2.Label4.Text = score
Form5.Show()
ElseIf score > score5 Or score = score4 Then
scorename = 5
Form2.Label10.Text = "-"
Form2.Label5.Text = score
Form5.Show()
Form5.Timer1.Enabled = True
Else
End If
TmrMet.Enabled = False
Form2.Show()
PbxMet.Enabled = False
Me.Enabled = False
End If
)
'this bit is in the leader board form
(
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim score1 As String = Label1.Text
Dim score2 As String = Label2.Text
Dim score3 As String = Label3.Text
Dim score4 As String = Label4.Text
Dim score5 As String = Label5.Text
My.Settings.score1 = score1
My.Settings.score2 = score2
My.Settings.score3 = score3
My.Settings.score4 = score4
My.Settings.score5 = score5
My.Settings.name1 = Label6.Text
My.Settings.name2 = Label7.Text
My.Settings.name3 = Label8.Text
My.Settings.name4 = Label9.Text
My.Settings.name5 = Label10.Text
My.Settings.Save()
Form4.Show()
Form1.Enabled = True
Form1.Close()
Me.Close()
End Sub
)
does anyone know why it isn't save/ loading.
thanks in advance
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|