-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmMain.frm
388 lines (353 loc) · 10.5 KB
/
frmMain.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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
VERSION 5.00
Object = "{27395F88-0C0C-101B-A3C9-08002B2F49FB}#1.1#0"; "PICCLP32.OCX"
Begin VB.Form frmMain
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
Caption = "The Fecal Emmiting Dragon"
ClientHeight = 6705
ClientLeft = 45
ClientTop = 390
ClientWidth = 7920
Icon = "frmMain.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 447
ScaleMode = 3 'Pixel
ScaleWidth = 528
StartUpPosition = 3 'Windows Default
Begin VB.Timer tmrShitFall
Enabled = 0 'False
Interval = 25
Left = 1560
Top = 4320
End
Begin VB.PictureBox picApple
BackColor = &H00000000&
BorderStyle = 0 'None
Height = 480
Index = 0
Left = 7080
Picture = "frmMain.frx":0442
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 0
TabStop = 0 'False
Top = 4920
Visible = 0 'False
Width = 480
End
Begin VB.TextBox Text1
BackColor = &H00000000&
BorderStyle = 0 'None
Height = 375
Left = -1440
TabIndex = 2
Text = "Text1"
Top = 5160
Width = 1575
End
Begin VB.Timer tmrMove
Interval = 25
Left = 840
Top = 4320
End
Begin VB.Timer Timer1
Interval = 75
Left = 360
Top = 4320
End
Begin PicClip.PictureClip pcpDragon
Index = 0
Left = 1920
Top = 960
_ExtentX = 8334
_ExtentY = 2778
_Version = 393216
Rows = 2
Cols = 3
Picture = "frmMain.frx":1000
End
Begin PicClip.PictureClip pcpDragon
Index = 1
Left = 1920
Top = 2520
_ExtentX = 8334
_ExtentY = 2778
_Version = 393216
Rows = 2
Cols = 3
Picture = "frmMain.frx":19526
End
Begin VB.PictureBox PicDragon
BackColor = &H00000000&
BorderStyle = 0 'None
Height = 855
Left = 240
ScaleHeight = 855
ScaleWidth = 1575
TabIndex = 1
TabStop = 0 'False
Top = 2160
Width = 1575
End
Begin VB.PictureBox picMan
BackColor = &H00000000&
BorderStyle = 0 'None
Height = 3135
Left = 4560
ScaleHeight = 3135
ScaleWidth = 1935
TabIndex = 3
TabStop = 0 'False
Top = 6480
Width = 1935
End
Begin PicClip.PictureClip pcpMan
Left = -840
Top = 6360
_ExtentX = 14049
_ExtentY = 10583
_Version = 393216
Rows = 3
Cols = 4
Picture = "frmMain.frx":31A4C
End
Begin VB.Shape shpShit
BackColor = &H00C0FFFF&
BackStyle = 1 'Opaque
BorderWidth = 2
Height = 255
Left = 6960
Shape = 2 'Oval
Top = 3960
Visible = 0 'False
Width = 255
End
Begin VB.Label lblAmmo
BackColor = &H00000000&
Caption = "0000"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 1200
TabIndex = 7
Top = 480
Width = 975
End
Begin VB.Label Label2
BackColor = &H00000000&
Caption = "Ammo:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 120
TabIndex = 6
Top = 480
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00000000&
Caption = "Score:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 120
TabIndex = 5
Top = 120
Width = 975
End
Begin VB.Label lblScore
BackColor = &H00000000&
Caption = "0000"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 375
Left = 1200
TabIndex = 4
Top = 120
Width = 1815
End
Begin VB.Shape shpGround
BackColor = &H00004080&
BackStyle = 1 'Opaque
Height = 525
Left = 0
Top = 5760
Width = 10455
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private CurrCell As Byte
Private SHPix As Integer
Private SWPix As Integer
Private CellsWide As Integer
Private CellsHigh As Integer
Private MoveDir As Byte
Private MoveLen As Integer
Private Ammo As Integer
Private FacingLeft As Boolean
Private Score As Integer
Private ShitFalling As Boolean
Private Sub Form_Load()
Randomize Timer
SHPix = Screen.Height / Screen.TwipsPerPixelY
SWPix = Screen.Width / Screen.TwipsPerPixelX
CellsWide = Int(SWPix / 32)
CellsHigh = Int(SHPix / 32)
frmMain.Top = 0
frmMain.Left = 0
frmMain.Width = Screen.Width
frmMain.Height = Screen.Height
shpGround.Top = SHPix - 50
shpGround.Width = SWPix
picMan.Height = pcpMan.CellHeight
picMan.Width = pcpMan.CellWidth
picMan.Top = shpGround.Top - picMan.Height
Dim x
For x = 1 To 5
Load picApple(x)
picApple(x).Top = Int(Rnd * (SHPix - 210))
picApple(x).Left = Int(Rnd * SWPix)
picApple(x).Visible = True
Next x
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 32
If ShitFalling = True Then Exit Sub
If Ammo <= 0 Then Exit Sub
Ammo = Ammo - 1
lblAmmo.Caption = Ammo
ShitFalling = True
tmrShitFall.Enabled = True
shpShit.Top = PicDragon.Top + PicDragon.Height
If FacingLeft = True Then shpShit.Left = PicDragon.Left + 100
If FacingLeft = False Then shpShit.Left = PicDragon.Left
shpShit.Visible = True
Case 37
If MoveDir <> 0 Then Exit Sub
MoveDir = 1
Case 38
If MoveDir <> 0 Then Exit Sub
MoveDir = 2
Case 39
If MoveDir <> 0 Then Exit Sub
MoveDir = 3
Case 40
If MoveDir <> 0 Then Exit Sub
MoveDir = 4
End Select
End Sub
Private Sub Timer1_Timer()
CurrCell = CurrCell + 1
If CurrCell > 5 Then CurrCell = 0
If FacingLeft = True Then PicDragon.Picture = pcpDragon(0).GraphicCell(CurrCell)
If FacingLeft = False Then PicDragon.Picture = pcpDragon(1).GraphicCell(CurrCell)
picMan.Picture = pcpMan.GraphicCell(CurrCell)
picMan.Left = picMan.Left + 12
If picMan.Left >= SWPix Then
picMan.Left = -4
End If
End Sub
Private Sub tmrMove_Timer()
If MoveDir = 0 Then Exit Sub
If MoveLen > 2 Then
MoveDir = 0
MoveLen = 0
End If
Select Case MoveDir
Case 1
FacingLeft = True
MoveLen = MoveLen + 1
If PicDragon.Left <= 32 Then
PicDragon.Left = SWPix - 15
Else
PicDragon.Left = PicDragon.Left - 16
End If
Case 2
MoveLen = MoveLen + 1
If PicDragon.Top <= 16 Then
PicDragon.Top = 0
Else
PicDragon.Top = PicDragon.Top - 16
End If
Case 3
FacingLeft = False
MoveLen = MoveLen + 1
If PicDragon.Left >= SWPix - 15 Then
PicDragon.Left = -16
Else
PicDragon.Left = PicDragon.Left + 16
End If
Case 4
MoveLen = MoveLen + 1
If PicDragon.Top >= SHPix - 200 Then
PicDragon.Top = SHPix - 190
Else
PicDragon.Top = PicDragon.Top + 16
End If
End Select
Dim x
For x = 1 To 5
If picApple(x).Left + picApple(x).Width >= PicDragon.Left And picApple(x).Left <= PicDragon.Left + PicDragon.Width And picApple(x).Top + picApple(x).Height >= PicDragon.Top And picApple(x).Top <= PicDragon.Top + PicDragon.Height Then
picApple(x).Visible = False
picApple(x).Top = Int(Rnd * (SHPix - 210))
picApple(x).Left = Int(Rnd * SWPix)
Ammo = Ammo + 1
lblAmmo.Caption = Ammo
picApple(x).Visible = True
End If
Next x
End Sub
Private Sub tmrShitFall_Timer()
shpShit.Top = shpShit.Top + 20
If shpShit.Top > shpGround.Top - picMan.Height Then
If shpShit.Left - shpShit.Width >= picMan.Left And shpShit.Left <= picMan.Left + picMan.Width Then
Score = Score + 1
lblScore.Caption = Score
ShitFalling = False
shpShit.Visible = False
Exit Sub
End If
End If
If shpShit.Top + shpShit.Height >= shpGround.Top Then
ShitFalling = False
shpShit.Visible = False
End If
End Sub