by Daniel Pilloni (1 Submission)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 7th February 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
A colorful diamond
API Declarations
'All you need is: A Timer named Timer1 and set the interval to 100
Dim y As Integer
Dim t(8) As Integer
Private Sub form_load()
Form1.BackColor = &H0&
x = Form1.Width / 1.995
y = Form1.Height / 3.1
K = 0
For i = 0 To 5
t(i) = K
K = K + 45
DrawWidth = 2
Next
End Sub
Private Sub timer1_timer()
If K > 7 Then K = 0
For i = 0 To 5
Line (x, y + 2600)-(x + 2200 * Sin(t(i)), y + 15 * Cos(t(i) * 15 / 120)), RGB(Int(Rnd * 333), Int(Rnd * 333), Int(Rnd * 333))
Line (x, y - 1200)-(x + 2200 * Sin(t(i)), y + 15 * Cos(t(i) * 15 / 120)), RGB(Int(Rnd * 333), Int(Rnd * 333), Int(Rnd * 333))
t(i) = t(i) - 2
Next
End Sub