DEF GDISK X,Y,RADIUS,COL
IF RADIUS<1 THEN GPSET X,Y,COL:RETURN '(GCIRCLE draws nothing if the radius is 0)
'get the point on the graphics layer that is closest to the center of the circle
VAR PX=MIN(MAX(X,0),512-1)
VAR PY=MIN(MAX(Y,0),512-1)
'if the distance from the center of the circle to the closest onscreen point is
'larger than the radius, then the circle is completely offscreen
VAR DX=PX-X
VAR DY=PY-Y
IF DX*DX+DY*DY > RADIUS*RADIUS THEN RETURN
'traditional filled circle code
GCIRCLE X,Y,RADIUS,8
GPAINT PX,PY,COL,8
GCIRCLE X,Y,RADIUS,COL
END

1 Comment(s)HeredosAvatar TabooI didn't change my avatar for 180 daysWebsiteIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthNight PersonI like the quiet night and sleep late.Express YourselfNeed this for my game. Thanks