Kryds og bolle VB5 programmering hjælp
HejJeg er i færd med at programmere et kryds og bolle spil, hvor man kan flytte "brikkerne" rundt på pladen. Jeg har fået denne funktion til at fungere, men jeg sidder lidt fast nu fordi man skal jo have at vide hvis en spiller vinder, men jeg ved ikke helt hvordan og hvor jeg skriver koden til dette, min kode ser således ud indtil videre:
_________________________________
Option Explicit
Private Sub lblfelt1_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X + 200
Source.Top = Y + 300
End Sub
Private Sub lblfelt2_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X + 1600
Source.Top = Y + 300
End Sub
Private Sub lblfelt3_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X + 3100
Source.Top = Y + 300
End Sub
Private Sub lblfelt4_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X + 200
Source.Top = Y + 1600
End Sub
Private Sub lblfelt5_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X + 1600
Source.Top = Y + 1600
End Sub
Private Sub lblfelt6_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X + 3100
Source.Top = Y + 1600
End Sub
Private Sub lblfelt7_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X + 200
Source.Top = Y + 2900
End Sub
Private Sub lblfelt8_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X + 1600
Source.Top = Y + 2900
End Sub
Private Sub lblfelt9_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X + 3100
Source.Top = Y + 2900
End Sub
Private Sub Form_Load()
Dim navn As String
Dim modstander As String
Dim PC As String
navn = InputBox("Velkommen til kryds og bolle, intast dit navn")
modstander = InputBox("Skriv navn på modstande, hvis du ønsker at spille mod PC'en, skriv PC")
lblnavn1.Caption = navn
lblnavn2.Caption = modstander
If modstander = PC Then
Randomize
End If
End Sub
_______________________________________