Лабораторная работа: Greating game on visual basic with multiplayer system
Else
o. Checked = True
x. Checked = False
sw = False
End If
If multiplayermode = True Then
'Sends who goes first message.
Dim dpmsg As DirectPlayMessage
Set dpmsg = dxplay. CreateMessage
Call dpmsg. WriteLong (MSG_XORO)
Call dpmsg. WriteByte (2)
Call dxplay. Send (MyPlayer, DPID_ALLPLAYERS, DPSEND_GUARANTEED, _
dpmsg)
End If
Debug. Print "menu X or O clicked sw is " & sw
End Sub
Public Sub restart_Click () 'Restarts Game and updates scores
GameUnderway = True
multiplayermode = True
If usermode = "host" Then
Dim dpmsg As DirectPlayMessage
Set dpmsg = dxplay. CreateMessage
Call dpmsg. WriteLong (MSG_RESTART)
Call dxplay. Send (MyPlayer, DPID_ALLPLAYERS, DPSEND_GUARANTEED, _
dpmsg)
End If
Call Initialize
If usermode = "host" Then
If sw = True Then