-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmSetup.frm
178 lines (162 loc) · 4.77 KB
/
frmSetup.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
VERSION 5.00
Begin VB.Form frmSetup
BackColor = &H00000000&
Caption = "Multi Snake"
ClientHeight = 5760
ClientLeft = 120
ClientTop = 450
ClientWidth = 9255
ForeColor = &H00FFFFFF&
KeyPreview = -1 'True
LinkTopic = "Form1"
ScaleHeight = 5760
ScaleWidth = 9255
StartUpPosition = 3 'Windows Default
Begin VB.Timer deathTimer
Enabled = 0 'False
Interval = 3000
Left = 7800
Top = 1320
End
Begin VB.CommandButton cmdGo
Caption = "Next"
BeginProperty Font
Name = "MS Sans Serif"
Size = 24
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 4560
TabIndex = 0
Top = 4680
Visible = 0 'False
Width = 1575
End
Begin VB.Label labID
Alignment = 2 'Center
BackStyle = 0 'Transparent
BeginProperty Font
Name = "Arial"
Size = 399.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 7395
Left = 0
TabIndex = 3
Top = 2160
Width = 10440
End
Begin VB.Label labStatus
Alignment = 2 'Center
BackStyle = 0 'Transparent
BeginProperty Font
Name = "Arial"
Size = 27.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 1035
Index = 1
Left = 240
TabIndex = 2
Top = 1920
Width = 10440
End
Begin VB.Label labStatus
Alignment = 2 'Center
BackStyle = 0 'Transparent
BeginProperty Font
Name = "Arial"
Size = 36
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 1995
Index = 0
Left = 0
TabIndex = 1
Top = 0
Width = 10440
End
End
Attribute VB_Name = "frmSetup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdGo_Click()
'Select operation
Select Case setupState
Case 0
'Move to selecting order
If clientsConnected > 0 Then
NetStartOrder
End If
Case 2
'Start game
Hide
NetStartGame
End Select
End Sub
Private Sub deathTimer_Timer()
'Disable timer and restart
deathTimer.Enabled = False
NetStartGame
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyEscape
NetCloseAll
Case vbKeySpace
'If a drone and selecting order, select it
If Not isController And setupState = 2 Then
Send1Byte 0, MSG_ORDERREQUEST
End If
End Select
End Sub
Private Sub Form_Load()
Show
'Host or controller
If MsgBox("Are you the controlling computer?", vbYesNo, "Multi Snake") = vbYes Then
'Setup controller
isController = True
Load frmControl
'Display IP
labStatus(0) = "You are the controller and your name / ip is " & frmControl.sock.LocalIP
labStatus(1) = "no computers are connected"
cmdGo.Visible = True
Else
isController = False
'Connect to controller
Dim controller As String
controller = InputBox("What is the controllers name / ip address?", "Multi Snake")
If Len(controller) = 0 Then End
labStatus(0) = "Connecting..."
labID = "X"
'Load control drone
Load frmControl
NetConnect controller
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
NetCloseAll
End
End Sub