10-08-2023, 06:21 PM
Wow -- that's a beauty, bplus! Love it. Really cool how you calculated the color changing. I had to steal borrow that method for the little tree thing I was playing with. Just what was missing. Added some yellow PSETs for highlights. Before using your colors my green tree looked like a head of broccoli. Made the branching go random (RND * 35) instead of +/- 45 so the tree growth looks a little more natural.
- Dav
- Dav
Code: (Select All)
Screen _NewImage(800, 600, 32)
tree 400, 600, -90, 100, 0: Sleep
Sub tree (x1, y1, angle, size, depth)
If depth <= 14 Then
x2 = x1 + size * Cos(angle * _Pi / 180)
y2 = y1 + size * Sin(angle * _Pi / 180)
k& = _RGB32((15 - depth) * 8, 64 + depth * 8, .25 * (15 - depth) * 12, 255 - depth * 18)
Line (x1, y1)-(x2, y2), k&: PSet (x1, y1), _RGBA(255, 255, 0, Rnd * 75)
tree x2, y2, angle - (Rnd * 35), size * .8, depth + 1
tree x2, y2, angle + (Rnd * 35), size * .8, depth + 1
End If
End Sub