Option Explicit
Dim intGamesPlayed As Integer
Dim intGamesLost As Integer
Dim intGamesWon As Integer
Dim intGamesTied As Integer
Dim intXPos As Integer
Dim intOPos As Integer 'Variables declared Globally'
Dim strPlayerSign As String
Private Sub cmdPlay_Click()
Dim intCounter As Integer
For intCounter = 0 To 8 'Game cleared so New one can start'
lblX(intCounter).Caption = ""
Next intCounter
End Sub
Private Sub cmdQuit_Click()
Unload frmTictactoe
End Sub
Private Sub cmdStart_Click()
Line1.Visible = True
Line2.Visible = True
Line3.Visible = True 'When Start Game Button is clicked objects appear'
Line4.Visible = True
lblTie.Visible = True
lblWon.Visible = True
lblPlayed.Visible = True
lblLost.Visible = True
cmdPlay.Visible = True
cmdQuit.Visible = True
End Sub
Private Sub Form_Load()
Dim intX As Integer
Line1.Visible = False
Line2.Visible = False
Line3.Visible = False 'As the form opens objects are invisible'
Line4.Visible = False
lblTie.Visible = False
lblWon.Visible = False
lblPlayed.Visible = False
lblLost.Visible = False
cmdPlay.Visible = False
cmdQuit.Visible = False
For intX = 0 To 7
lineThree(intX).Visible = False
Next
For intX = 0 To 8
lblX(intX).Caption = ""
Next
End Sub
Private Sub lblX_Click(Index As Integer)
lblX(Index).Caption = strPlayerSign
If strPlayerSign = "X" Then
strPlayerSign = "O" 'X's and O's appear onto game board'
Else
strPlayerSign = "X"
End If
End Sub
Mod Edit: Please use code tags when posting code, like
PsychoCoder

New Topic/Question
Reply




MultiQuote



|