07-11-2023, 05:35 PM
Thanks, mnrvovrfc.
Here's another version I played around with today, using SQR + PSET. Added transparency. Small, but slower though.
- Dav
Here's another version I played around with today, using SQR + PSET. Added transparency. Small, but slower though.
- Dav
Code: (Select All)
SCREEN _NEWIMAGE(800, 600, 32)
DO
ball RND * _WIDTH, RND * _HEIGHT, RND * 400 + 25, RND * 255, RND * 255, RND * 255, 100 + RND * 155
_LIMIT 5
LOOP UNTIL INKEY$ <> ""
SUB ball (x, y, size, r, g, b, a)
FOR y2 = y - size TO y + size
FOR x2 = x - size TO x + size
clr = (size - (SQR((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y)))) / size
IF clr > 0 THEN PSET (x2, y2), _RGBA(clr * r, clr * g, clr * b, a)
NEXT
NEXT
END SUB