我想要一个用VB语言编写的游戏编程?

只要完整的内容,非常感谢!
2025年03月01日 08:33
有2个网友回答
网友(1):

Private Sub Timer1_Timer() Dim ms As Boolean Dim Info, temp As String Dim p, p1, p2, i As Integer Dim Ch ' Begin of Time Show Process If ModemState <> LOGIN And SocketState <> CONNECTED Then 'it is not a multiusers game Exit Sub Else If (S_R = 1) And (TURN = BLACKP) Then Black_Time = Black_Time + Time - Start_Time TimeB.Caption = CDate(Black_Time / 200) Else If (S_R = 1) And (TURN = WHITEP) Then White_Time = White_Time + Time - Start_Time TimeW.Caption = CDate(White_Time / 200) Else If (S_R = 0) And (TURN = WHITEP) Then Black_Time = Black_Time + Time - Start_Time TimeB.Caption = CDate(Black_Time / 200) Else If (S_R = 0) And (TURN = BLACKP) Then White_Time = White_Time + Time - Start_Time TimeW.Caption = CDate(White_Time / 200) End If End If End If End If End If 'End If ' End of Time Show Process 'Begin of winsockt process If SocketState = CONNECTED And Begin_Flag = 1 Then ms = Net.Message_Exist If ms = False Then Exit Sub End If Info = Net.WaitForValue(Chr$(26), 5) If g_ErrorCode = 1 Then 'Some error such as Timeout occured Exit Sub End If p1 = InStr(Info, "B") p2 = InStr(Info, "E|;") If p1 = 0 Or p2 = 0 Then Exit Sub End If temp = Mid$(Info, p1 + 1, p2 - p1 - 1) ParseLine (temp) Msg(Msg_No).No = CInt(ParseArray(1)) Msg(Msg_No).Color = CInt(ParseArray(2)) If IsNumeric(ParseArray(3)) Then Msg(Msg_No).X = CInt(ParseArray(3)) Msg(Msg_No).Y = CInt(ParseArray(4)) Else Msg(Msg_No).X = ParseArray(3) Msg(Msg_No).Y = ParseArray(4) End If If Msg(Msg_No).Color = GIVEUP Then Beep MsgBox ("对方已经认输了") Net.Winsock1.SendData ("R_O" + Chr$(26)) Pause 3 Call Begin_Click Exit Sub End If If Side = BLACKP Then p = Draw_Point(Msg(Msg_No).X, Msg(Msg_No).Y, WHITEP) Record(Step).Color = WHITEP step_show.Cls step_show.Print Step TURN = BLACKP Else p = Draw_Point(Msg(Msg_No).X, Msg(Msg_No).Y, BLACKP) Record(Step).Color = BLACKP step_show.Cls step_show.Print Step TURN = WHITEP End If Record(Step).X = Msg(Msg_No).X Record(Step).Y = Msg(Msg_No).Y Step = Step + 1 S_R = 1 R_R = 0 p = Count_All_Gas If (Msg(Msg_No).X > 0 And Msg(Msg_No).Y > 0 _ And Msg(Msg_No).X < 20 And Msg(Msg_No).Y < 20) Then Board(Msg(Msg_No).X, Msg(Msg_No).Y).Current = True Refresh_Board Board(Msg(Msg_No).X, Msg(Msg_No).Y).Current = False End If Msg_No = Msg_No + 1 Pause 1 Net.Winsock1.SendData ("R_O" + Chr$(26)) Exit Sub End If 'End of process of winsocket 'Begin of modem process If ModemState <> LOGIN Or R_R <> 1 Then 'It isn't a Inter_Modem Game Exit Sub End If ms = Modem_F.Exist_Msg If ms = False Then 'IO Port don't have any message Exit Sub End If 这是围棋的部分代码

网友(2):

算了给你网址 http://zhidao.baidu.com/question/45213102.html