下学场景的制作
scfan吧
全部回复
仅看楼主
level 5
scfan 楼主
Option ExplicitDim iSnow(1000, 2), iSnowCount As IntegerDim bLabel As BooleanPrivate Sub Form_Load() Dim i, j, ls As Integer Dim iOldX, iOldY, iColor As Integer With MainFrm .BorderStyle = vbBSNone .WindowState = vbMaximized .BackColor = RGB(0, 0, 0) .Show End With With lblShow .BackStyle = 0 .ForeColor = RGB(255, 255, 255) End With bLabel = False DoEvents iSnowCount = 325 Randomize: For j = 1 To iSnowCount iSnow(j, 0) = Int(Rnd * MainFrm.Width) iSnow(j, 1) = Int(Rnd * MainFrm.Height) iSnow(j, 2) = 10 + (Rnd * 20) Next j Do While Not (DoEvents = 0) For ls = 1 To 10 For i = 1 To iSnowCount iOldX = iSnow(i, 0) iOldY = iSnow(i, 1) iSnow(i, 1) = iSnow(i, 1) + iSnow(i, 2) If iSnow(i, 1) > MainFrm.Height Then iSnow(i, 1) = 0 iSnow(i, 2) = 5 + (Rnd * 30) iSnow(i, 0) = Int(Rnd * MainFrm.Width) iOldX = 0 iOldY = 0 End If iColor = 8 * (iSnow(i, 2) - 10) iColor = 60 + iColor If Not ((iOldX > lblShow.Left) And (iOldX < lblShow.Left + lblShow.Width) And (iOldY > lblShow.Top) And (iOldY < lblShow.Top + lblShow.Height)) Then PSet (iOldX, iOldY), QBColor(0) End If If Not ((iSnow(i, 0) > lblShow.Left) And (iSnow(i, 0) < lblShow.Left + lblShow.Width) And (iSnow(i, 1) > lblShow.Top) And (iSnow(i, 1) < lblShow.Top + lblShow.Height)) Then PSet (iSnow(i, 0), iSnow(i, 1)), RGB(iColor, iColor, iColor) End If Next i Next ls LoopEnd SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If bLabel Then With lblShow .ForeColor = RGB(255, 255, 255) .FontItalic = False .MousePointer = vbDefault End With bLabel = False End IfEnd SubPrivate Sub lblShow_Click() EndEnd SubPrivate Sub lblShow_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) With lblShow .ForeColor = RGB(0, 0, 255) .FontItalic = True .MousePointer = vbCustom End With bLabel = TrueEnd Sub
2006年05月01日 13点05分 1
level 2
下雪 ?!
2006年05月06日 05点05分 2
1