06-20-2022, 09:50 PM
Here is my version. It only stays as a triangle but I think it's cool.
Code: (Select All)
_Title "Floating Triangle - by Sierraken"
Screen _NewImage(800, 800, 32)
dirrr = .1
dirx = -1
diry = 1
cenx = 400
ceny = 400
length1 = Rnd * 50
length2 = Rnd * 50
length3 = Rnd * 50
Do
_Limit 15
If cenx > 600 Then dirx = -1 * Rnd * 3
If cenx < 200 Then dirx = 1 * Rnd * 3
If ceny > 600 Then diry = -1 * Rnd * 3
If ceny < 200 Then diry = 1 * Rnd * 3
t = t + .1
If t = 2 Then
dirr = Int(Rnd * 4) + 1
If dirr = 1 Then dirx = -1 * Rnd * 3
If dirr = 2 Then dirx = 1 * Rnd * 3
If dirr = 3 Then diry = -1 * Rnd * 3
If dirr = 4 Then diry = 1 * Rnd * 3
length1 = Rnd * 50
length2 = Rnd * 50
length3 = Rnd * 50
End If
If t = 6 Then
dirr2 = Int(Rnd * 2)
If dirr2 = 1 Then dirrr = -.1
If dirr2 = 2 Then dirrr = .1
length1 = Rnd * 50
length2 = Rnd * 50
length3 = Rnd * 50
End If
cenx = cenx + dirx
ceny = ceny + diry
seconds = seconds + dirrr
s = (60 - seconds) * 6 + 180
x = Int(Sin(s / 180 * 3.141592) * 125) + cenx
y = Int(Cos(s / 180 * 3.141592) * 125) + ceny
m = 180 - seconds * 6
xx = Int(Sin(m / 180 * 3.141592) * 120) + x
yy = Int(Cos(m / 180 * 3.141592) * 120) + y
c1 = c1 + 1
c2 = c2 + 1
c3 = c3 + 1
If c1 > 255 Then
c1 = Rnd * 255
c2 = Rnd * 255
c3 = Rnd * 255
End If
For b = -5 To 5 Step .1
Line (x + b + length3, y + b + length3)-(xx + b + length1, yy + b + length1), _RGB32(c1, c2, c3)
Next b
h = 360 - seconds * 30 + 180
xxx = Int(Sin(h / 180 * 3.141592) * 100) + xx
yyy = Int(Cos(h / 180 * 3.141592) * 100) + yy
For b = -5 To 5 Step .1
Line (xx + b + length1, yy + b + length1)-(xxx + b + length2, yyy + b + length2), _RGB32(c1, c2, c3)
Next b
For b = -5 To 5 Step .1
Line (xxx + b + length2, yyy + b + length2)-(x + b + length3, y + b + length3), _RGB32(c1, c2, c3)
Next b
If t > 12 Then
t = 0
End If
_Display
Line (0, 0)-(800, 800), _RGB32(0, 0, 0, 30), BF
Loop Until InKey$ = Chr$(27)