-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfMain.frm
267 lines (211 loc) · 6.42 KB
/
fMain.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
VERSION 5.00
Begin VB.Form fMain
BorderStyle = 1 'Fixed Single
Caption = "Slither Game"
ClientHeight = 9975
ClientLeft = -15
ClientTop = 375
ClientWidth = 15540
BeginProperty Font
Name = "Tahoma"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 665
ScaleMode = 3 'Pixel
ScaleWidth = 1036
StartUpPosition = 1 'CenterOwner
WindowState = 2 'Maximized
Begin VB.PictureBox PicPanel
Appearance = 0 'Flat
ForeColor = &H80000008&
Height = 5895
Left = 13440
ScaleHeight = 391
ScaleMode = 3 'Pixel
ScaleWidth = 127
TabIndex = 1
Top = 240
Width = 1935
Begin VB.CheckBox chkMAP
Caption = "Draw MAP"
Height = 495
Left = 240
TabIndex = 9
ToolTipText = "Show MAP"
Top = 3120
Width = 1455
End
Begin VB.CheckBox chkFlag
Caption = "Draw Flags"
Height = 495
Left = 240
TabIndex = 8
Top = 2400
Width = 1455
End
Begin VB.HScrollBar hSnake
Height = 375
Left = 0
TabIndex = 7
Top = 5280
Width = 1935
End
Begin VB.CheckBox chkAI
Caption = "AI control"
Height = 495
Left = 240
TabIndex = 6
ToolTipText = "AI moves the player"
Top = 1680
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "START"
Height = 615
Left = 120
TabIndex = 5
Top = 120
Width = 1695
End
Begin VB.CheckBox chkBB
Caption = "Draw BB"
Height = 495
Left = 240
TabIndex = 4
ToolTipText = "Debug Draw Bounding Boxes"
Top = 3840
Width = 1455
End
Begin VB.CheckBox chkJPG
Caption = "Save PNG Frames"
Height = 495
Left = 240
TabIndex = 3
ToolTipText = "Save Frame to create a Video"
Top = 4560
Width = 1455
End
Begin VB.CheckBox chkBG
Caption = "BackGround"
Height = 495
Left = 240
TabIndex = 2
ToolTipText = "Draw Background"
Top = 960
Value = 1 'Checked
Width = 1455
End
End
Begin VB.PictureBox PIC
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 9495
Left = 120
MousePointer = 2 'Cross
ScaleHeight = 633
ScaleMode = 3 'Pixel
ScaleWidth = 801
TabIndex = 0
Top = 120
Width = 12015
End
End
Attribute VB_Name = "fMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub chkAI_Click()
AIcontrol = (chkAI.Value = vbChecked)
End Sub
Private Sub chkBB_Click()
DoDrawBB = (chkBB.Value = vbChecked)
End Sub
Private Sub chkBG_Click()
DoBackGround = (chkBG.Value = vbChecked)
End Sub
Private Sub chkFlag_Click()
DoDrawFlags = (chkFlag.Value = vbChecked)
End Sub
Private Sub chkJPG_Click()
SaveFrames = (chkJPG.Value = vbChecked)
End Sub
Private Sub chkMAP_Click()
DoDrawMAP = (chkMAP.Value = vbChecked)
End Sub
Private Sub Form_Load()
RndM Timer
'MsgBox Cairo.CalcArc(2, 3)
PIC.Width = PIC.Height * 4 / 3
' Stop
PIC.Refresh
If Dir(App.Path & "\Frames", vbDirectory) = vbNullString Then MkDir App.Path & "\Frames"
If Dir(App.Path & "\Frames\*.*") <> vbNullString Then Kill App.Path & "\Frames\*.*"
InitRC
InitResources
Level = 1
Set MultipleSounds = New cSounds
DoBackGround = True
Open App.Path & "\LOG.txt" For Output As 1
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
DoLOOP = False
End Sub
Private Sub Form_Resize()
PIC.Width = Me.ScaleWidth '- 16
PIC.Height = Me.ScaleHeight '- 16
PIC.Width = (PIC.Width \ 8) * 8
PIC.Height = (PIC.Height \ 8) * 8
PIC.Left = (Me.ScaleWidth - PIC.Width) \ 2
PIC.Top = (Me.ScaleHeight - PIC.Height) \ 2
PicPanel.Top = PIC.Top
PicPanel.Left = PIC.Left + PIC.Width - PicPanel.Width
InitRC
End Sub
Private Sub Form_Unload(Cancel As Integer)
' DestroySoundManager
Close 1
UnloadRC
End Sub
Private Sub Command1_Click()
InitPool 6
InitFOOD 6 * FoodXSnake '100
Command1.Enabled = False
MainLoop
End Sub
Private Sub hSnake_Change()
SNAKECAMERA = hSnake.Value
End Sub
Private Sub hSnake_Scroll()
SNAKECAMERA = hSnake.Value
End Sub
Private Sub PIC_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If DoLOOP Then Snake(PLAYER).FASTspeed = -1
End Sub
Private Sub PIC_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
MousePos.x = x - CenX
MousePos.y = y - CenY
End Sub
Private Sub PIC_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If DoLOOP Then Snake(PLAYER).FASTspeed = 0
End Sub