[求助]怎样编一个下星星的程序?
偶想要一个类似于下雪或者下雨的程序代码,例如下羽毛,下花瓣,下星星等以下是下雪的,可以改成下星星吗?
Dim Snow(1000, 2), Amounty As Integer
Dim x As Long
Private Sub Form_Load()
Me.Show
DoEvents
Randomize
Amounty = 825
For j = 1 To Amounty
Snow(j, 0) = Int(Rnd * Me.Width)
Snow(j, 1) = Int(Rnd * Me.Height)
Snow(j, 2) = 10 + (Rnd * 20)
Next j
Do While Not (DoEvents = 0)
For LS = 1 To 10
For i = 1 To Amounty
OldX = Snow(i, 0): OldY = Snow(i, 1)
Snow(i, 1) = Snow(i, 1) + Snow(i, 2)
If Snow(i, 1) > Me.Height Then
Snow(i, 1) = 0: Snow(i, 2) = 5 + (Rnd * 30)
Snow(i, 0) = Int(Rnd * Me.Width)
OldX = 0: OldY = 0
End If
coloury = 8 * (Snow(i, 2) - 10): coloury = 60 + coloury
PSet (OldX, OldY), QBColor(0)
PSet (Snow(i, 0), Snow(i, 1)), RGB(coloury, coloury, coloury)
Next i
Next LS
Loop
End
End Sub