An updated version which I guess I'd call a simple "Dancing Triangle":
For just goofing and wasting time, that's not an overall bad effect for such simple little code.
Code: (Select All)
Screen _NewImage(800, 600, 32)
_FullScreen
Dim x1, y1, x2, y2, x3, y3
Dim dx1, dy1, dx2, dy2, dx3, dy3
Dim r, g, b As Integer
' Initialize coordinates and directions
x1 = Int(Rnd * 800): y1 = Int(Rnd * 600)
x2 = Int(Rnd * 800): y2 = Int(Rnd * 600)
x3 = Int(Rnd * 800): y3 = Int(Rnd * 600)
dx1 = 5: dy1 = 8: dx2 = -5: dy2 = -8: dx3 = 2: dy3 = 3
Do
r = Int(Rnd * 256): g = Int(Rnd * 256): b = Int(Rnd * 256): a = Int(Rnd * 256)
Line (x1, y1)-(x2, y2), _RGBA32(r, g, b, a)
Line -(x3, y3), _RGBA(r, g, b, a)
Line -(x1, y1), _RGBA(r, g, b, a)
' Update coordinates
x1 = x1 + dx1: y1 = y1 + dy1: x2 = x2 + dx2: y2 = y2 + dy2: x3 = x3 + dx3: y3 = y3 + dy3
' Bounce off the edges of the screen
If x1 <= 0 Or x1 >= 800 Then dx1 = -dx1
If y1 <= 0 Or y1 >= 600 Then dy1 = -dy1
If x2 <= 0 Or x2 >= 800 Then dx2 = -dx2
If y2 <= 0 Or y2 >= 600 Then dy2 = -dy2
If x3 <= 0 Or x3 >= 800 Then dx3 = -dx3
If y3 <= 0 Or y3 >= 600 Then dy3 = -dy3
Line (0, 0)-(_Width, _Height), &H10000020&&, BF
_Display
_Limit 60
Loop Until InKey$ <> ""
System
For just goofing and wasting time, that's not an overall bad effect for such simple little code.
