NaaLaa Forum
MandalaV1 - Printable Version

+- NaaLaa Forum (http://www.naalaa.com/community)
+-- Forum: NaaLaa (http://www.naalaa.com/community/forumdisplay.php?fid=1)
+--- Forum: Showcase (http://www.naalaa.com/community/forumdisplay.php?fid=4)
+--- Thread: MandalaV1 (/showthread.php?tid=253)



MandalaV1 - Rick3137 - 11-25-2019

I'm back to art programs.

 In this series, I'm doing single Mandalas instead of art programs with lots of buttons.

 I will later attempt to create a graphics file for each Mandala. Several of these should be good material for a video.

Code:
'  By Rick3137    http://rb23.yolasite.com/
'  You have permission to copy, paste, alter or post anywhere as long as you don't copyright my work.
'  If it breaks your computer or does damage to your health or wealth , I didn't do it.
'  If you repost this material to another website like Utube, please make changes to the content and name so no one gets confused.
visible:
'event = 1 ; mx = 0 ; my = 0
hidden:
set redraw off

set window 0, 0, 1200, 700
  set color 0,0,10
  cls
  proc Mandala

 ' proc Mandala1
  redraw
  wait keydown
end

procedure Setup()

endproc

procedure PrintText()
     
     set caret 10,200
     write " MouseX = " ; wln str$(mx)
     write " MouseY = " ; wln str$(my)
     
endproc
        function MoveX#(x#, d#, angle#)
           x2# = 0.0;
           dx# = cos#( angle# )
           x2 = x + (dx * d);
           return x2;
        endfunc

        function MoveY#(y#, d#, angle#)
            y2# = 0.0;
            dy# = sin#( angle# )
            y2 = y - (dy * d);
            return y2;
        endfunc

      procedure DrawStar(x#, y#, size#)
          cnt = 1 ; angle# = 360.0
           x = x - size/2.0 ; y = y - size/6.0  
           x2# = x + size;
           y2# = y;
           
          while cnt < 6
             
               draw line int(x),int(y), int(x2), int(y2)
               angle = angle - 144.0
               x = x2; y = y2;
               x2# = MoveX(x, size, angle) ;  y2# = MoveY(y, size, angle)

               cnt = cnt + 1;
           wend
      endproc

      procedure DrawStar9(x#, y#, size#)
         z = 1
           x = x - size/2.0 ; y = y - size/6.0
        while z < 9
           cnt = 1 ; angle# = 360.0
 
           x2# = x + size;
           y2# = y;
          while cnt < 6
             
               draw line int(x),int(y), int(x2), int(y2)
               angle = angle - 144.0
               x = x2; y = y2;
               x2# = MoveX(x, size, angle) ;  y2# = MoveY(y, size, angle)

               cnt = cnt + 1;
           wend
           z = z + 1
           size = size - 1.0 ; cnt = 1
        '  x = x - size/2.0 ; y = y - size/6.0
          wend
      endproc

procedure DrawPentagon(x#,y#,radius#)
 x1#; y1#; x2#; y2#; angle1# ; dx1# ; dy1# ; angle2# ; dx2# ; dy2#
 angle1 = 54.0
 angle2 = angle1 + 72.0
 
 b=0
 while radius > 0.0
  for a = 1 to 5
    dy1 = sin(angle1) * radius
    dx1 = cos(angle1) * radius
    dy2 = sin(angle2) * radius
    dx2 = cos(angle2) * radius
    x1 = x + dx1 ; x2 = x + dx2
    y1 = y + dy1 ; y2 = y + dy2
    draw line int(x1),int(y1),int(x2),int(y2)
    angle1 = angle1 + 72.0
    angle2 = angle2 + 72.0
  next
  radius = radius - 0.001
  b=b+1
 
 wend
endproc
     
      procedure Circle( x#, y#, size# , type )
           angle# = 0.0; cnt = 1; distance# = size/ 2.0
          x2 = int(x)
          y2 = int(y)
          size2 = int(size) ; size3 = int(size/ 2.0)
          if type = 0 then draw ellipse x2,y2,size2,size2,0
          if type = 1 then draw ellipse x2,y2,size2,size2,1
          if type = 2
           while cnt < 33
               x3# = MoveX(x, distance, angle) ;  y3# = MoveY(y, distance , angle)
               x4 = int(x3) ; y4 = int(y3)
               draw ellipse x4,y4,size3,size3,0
           angle = angle + 11.25;
           cnt = cnt + 1
           wend
          endif
      endproc

      procedure Circle8( x#, y#, size# , distance#, type)
           angle# = 0.0; cnt = 1;  
           while cnt < 33
              x2# = MoveX(x, distance, angle) ;  y2# = MoveY(y, distance , angle)
              proc Circle  x2,  y2, size, type ;
           angle = angle + 11.25;
           cnt = cnt + 1
           wend
      endproc

      procedure Circle8x( x#, y#, size#, distance1#, distance2#, type)
           angle1# = 0.0; cnt1 = 1; angle2# = 0.0; cnt2 = 1;  
           while cnt1 < 9
              x2# = MoveX(x, distance1, angle1) ;  y2# = MoveY(y, distance1 , angle1)
                   cnt2 = 1 ; angle2 = 0.0
                   while cnt2 < 9
                      x3# = MoveX(x2, distance2, angle2) ;  y3# = MoveY(y2, distance2 , angle2)
                      proc Circle  x3,  y3, size, type ;
                      angle2 = angle2 + 45.0;
                      cnt2 = cnt2 + 1

                   wend
           angle1 = angle1 + 45.0;
           cnt1 = cnt1 + 1
           wend

      endproc

      procedure Circle16( x#, y#, size# , distance#, type)
           angle# = 0.0; cnt = 1;  
           while cnt < 17
              x2# = MoveX(x, distance, angle) ;  y2# = MoveY(y, distance , angle)
              proc Circle  x2,  y2, size, type ;
           angle = angle + 22.5;
           cnt = cnt + 1
      wend
      endproc

   
      procedure Circle32( x#, y#, size# , distance#, type)
           angle# = 0.0; cnt = 1;  
           while cnt < 33
              x2# = MoveX(x, distance, angle) ;  y2# = MoveY(y, distance , angle)
              proc Circle  x2,  y2, size, type ;
           angle = angle + 11.25;
           cnt = cnt + 1
      wend
      endproc

      procedure Circle32a( x#, y#, size# , distance#, type)
           angle# = 5.625 ; cnt = 1;
            while cnt < 33 ;
              x2# = MoveX(x, distance, angle) ;  y2# = MoveY(y, distance , angle)
              proc Circle  x2,  y2, size, type ;
           angle = angle + 11.25;
           cnt = cnt + 1
      wend
      endproc

      procedure Circle180( x#, y#, size# , distance#, type)
           angle# = 0.0; cnt = 1;  
           while cnt < 181
              x2# = MoveX(x, distance, angle) ;  y2# = MoveY(y, distance , angle)
              proc Circle  x2,  y2, size, type ;
           angle = angle + 2.0;
           cnt = cnt + 1
      wend
      endproc
procedure Mandala1()
  set color 0,0,0
  cls

    angle# = 0.0; cnt = 1; x# = 600.0 ; y# = 350.0 ; size# = 40.0 ; d# = 100.0 ; angle2# = 22.5
        ' center
    set color 0,30,80 ; proc Circle  x,  y, 350.0, 1 ;
    set color 0,40,60 ; proc Circle180  x,  y, 80.0, 270.0, 0 ;

    set color 0,40,160 ; proc Circle  x,  y, 200.0, 1 ;
    set color 0,170,150 ; proc Circle32  x,  y, 60.0, 140.0, 0 ;
    set color 255,255,255 ; proc Circle32  x,  y, 10.0, 190.0, 0 ;
      proc Circle32  x,  y, 30.0, 20.0, 0 ; proc Circle32  x,  y, 6.0, 190.0, 1 ;

    while cnt < 9
     
      x2# = MoveX(x, 90.0, angle) ;  y2# = MoveY(y, 90.0, angle) ; set color 0,0,255
       proc Circle  x2,  y2, 30.0, 1 ; set color 255,255,255 ; proc Circle  x2,  y2, 30.0, 0 ;
       proc Circle32  x2,  y2,  10.0,20.0, 0 ;
    '  x2# = MoveX(x, 150.0, angle) ;  y2# = MoveY(y, 150.0, angle) ; set color 50,50,255
    '   proc Circle  x2,  y2, 25.0, 1 ; set color 200,200,255 ; proc Circle  x2,  y2, 25.0, 0 ;
        set color 0,155,255 ; proc Circle32  x2, y2, 10.0,10.0, 0 ;
      x2# = MoveX(x, 227.0, angle) ;  y2# = MoveY(y, 227.0, angle) ; set color 100,100,255
       proc Circle  x2,  y2, 22.0, 1 ; set color 255,255,255 ; proc Circle  x2,  y2, 22.0, 0 ;
       set color 0,255,155 ; proc Circle32  x2, y2, 8.0,8.0, 0 ;
      x2# = MoveX(x, 275.0, angle) ;  y2# = MoveY(y, 275.0, angle) ; set color 150,150,255
       proc Circle  x2,  y2, 19.0, 1 ; set color 255,255,255 ; proc Circle  x2,  y2, 19.0, 0 ;
       set color 0,150,100 ; proc Circle32  x2, y2, 8.0,8.0, 0 ;
      x2# = MoveX(x, 320.0, angle) ;  y2# = MoveY(y, 320.0, angle)
       set color 255,255,255 ; proc Circle  x2,  y2, 16.0, 1 ;
       set color 0,200,200 ; proc Circle32  x2,  y2,  8.0,8.0, 0 ;
      angle = angle + 45.0;
      cnt = cnt + 1
    wend
     cnt = 1;
    while cnt < 9
       
          x2# = MoveX(x, 190.0, angle2) ;  y2# = MoveY(y, 190.0, angle2)
            set color 255,255,0 ; proc Circle32  x2,  y2,  30.0,30.0, 0 ;
          x2# = MoveX(x, 310.0, angle2) ;  y2# = MoveY(y, 310.0, angle2)
            set color 0,255,150 ; proc Circle  x2,  y2, 40.0, 1 ;
            set color 255,255,0 ; proc Circle32  x2,  y2,  26.0,26.0, 0 ;

        angle2 = angle2 + 45.0
        cnt = cnt + 1
    wend
endproc

procedure Mandala()
       ' Outer background
       set color 30,10,50
       cls

    angle# = 0.0; cnt = 1; x# = 600.0 ; y# = 350.0 ; size# = 40.0 ; d# = 100.0 ; angle2# = 22.5
        ' Middle Background
    set color 50,0,180 ; proc Circle  x,  y, 350.0, 1 ;
        ' Center Background
    set color 60,0,30 ; proc Circle  x,  y, 200.0, 1 ;

        ' Draw from center
    set color 0,40,60 ; proc Circle180  x,  y, 80.0, 270.0, 0 ;

    set color 0,170,150 ; proc Circle32  x,  y, 60.0, 140.0, 0 ;


      set color 255,0,0 ; proc Circle32  x,  y, 10.0, 190.0, 0  
      set color 255,55,255 ; proc Circle32  x,  y, 30.0, 20.0, 0
      set color 255,0,255 ; proc Circle32  x,  y, 6.0, 190.0, 1 ;

    while cnt < 9
      ' 8 main angles
      x2# = MoveX(x, 90.0, angle) ;  y2# = MoveY(y, 90.0, angle) ;
       set color 100,0,200 ;  proc Circle  x2,  y2, 10.0, 1  
       set color 255,255,255 ; proc Circle  x2,  y2, 30.0, 0 ;
       proc Circle32  x2,  y2,  10.0,20.0, 0 ;
   
       proc Circle  x2,  y2, 25.0, 1 ; set color 200,0,255 ; proc Circle  x2,  y2, 25.0, 0 ;
        set color 150,0,255 ; proc Circle32  x2, y2, 10.0,10.0, 0 ;
      x2# = MoveX(x, 227.0, angle) ;  y2# = MoveY(y, 227.0, angle) ; set color 100,0,255
       proc Circle  x2,  y2, 22.0, 1 ; set color 255,255,255 ; proc Circle  x2,  y2, 22.0, 0 ;
       set color 100,5,155 ; proc Circle32  x2, y2, 8.0,8.0, 0 ;
      x2# = MoveX(x, 275.0, angle) ;  y2# = MoveY(y, 275.0, angle) ; set color 150,0,255
       proc Circle  x2,  y2, 19.0, 1 ; set color 255,255,255 ; proc Circle  x2,  y2, 19.0, 0 ;
       set color 150,0,100 ; proc Circle32  x2, y2, 8.0,8.0, 0 ;
      x2# = MoveX(x, 320.0, angle) ;  y2# = MoveY(y, 320.0, angle)
       set color 255,255,255 ; proc Circle  x2,  y2, 16.0, 1 ;
       set color 50,0,200 ; proc Circle32  x2,  y2,  8.0,8.0, 0 ;
      angle = angle + 45.0;
      cnt = cnt + 1
    wend
     cnt = 1;
     ' alternate angles
    while cnt < 9
       
          x2# = MoveX(x, 190.0, angle2) ;  y2# = MoveY(y, 190.0, angle2)
            set color 255,5,155 ; proc Circle32  x2,  y2,  30.0,30.0, 0 ;
          x2# = MoveX(x, 310.0, angle2) ;  y2# = MoveY(y, 310.0, angle2)
            set color 250,55,150 ; proc Circle  x2,  y2, 40.0, 1 ;
            set color 255,100,200 ; proc Circle32  x2,  y2,  26.0,26.0, 0 ;

        angle2 = angle2 + 45.0
        cnt = cnt + 1
    wend
endproc



end



RE: MandalaV1 - Marcus - 11-27-2019

Looks nice, great work Smile


RE: MandalaV2 - Rick3137 - 12-16-2019

2nd, in a series.

' By Rick3137 http://rb23.yolasite.com/

' You have permission to copy, paste, alter or post anywhere as long as you don't copyright my work.

' If it breaks your computer or does damage to your health or wealth , I didn't do it.

' If you repost this material to another website like Utube, please make changes to the content and name so no one gets confused.

visible:

'event = 1 ; mx = 0 ; my = 0

hidden:

set redraw off

 

set window 0, 0, 1200, 700
set color 0,0,10
cls

proc Mandala

 
redraw

wait keydown

end

 

procedure Setup()

 

endproc

 

procedure PrintText()


set caret 10,200
write " MouseX = " ; wln str$(mx)
write " MouseY = " ; wln str$(my)



endproc

function MoveX#(x#, d#, angle#)

x2# = 0.0;
dx# = cos#( angle# )

x2 = x + (dx * d);
return x2;
endfunc

 
function MoveY#(y#, d#, angle#)

y2# = 0.0;
dy# = sin#( angle# )

y2 = y - (dy * d);
return y2;
endfunc

 
procedure DrawStar(x#, y#, size#)

cnt = 1 ; angle# = 360.0
x = x - size/2.0 ; y = y - size/6.0
x2# = x + size;
y2# = y;

while cnt < 6


draw line int(x),int(y), int(x2), int(y2)

angle = angle - 144.0
x = x2; y = y2;
x2# = MoveX(x, size, angle) ; y2# = MoveY(y, size, angle)
 
cnt = cnt + 1;
wend

endproc

 
procedure DrawStar9(x#, y#, size#)

z = 1
x = x - size/2.0 ; y = y - size/6.0
while z < 9

cnt = 1 ; angle# = 360.0

x2# = x + size;
y2# = y;
while cnt < 6


draw line int(x),int(y), int(x2), int(y2)

angle = angle - 144.0
x = x2; y = y2;
x2# = MoveX(x, size, angle) ; y2# = MoveY(y, size, angle)
 
cnt = cnt + 1;
wend

z = z + 1
size = size - 1.0 ; cnt = 1

' x = x - size/2.0 ; y = y - size/6.0

wend

endproc

 
procedure DrawPentagon(x#,y#,radius#)

x1#; y1#; x2#; y2#; angle1# ; dx1# ; dy1# ; angle2# ; dx2# ; dy2#
angle1 = 54.0
angle2 = angle1 + 72.0

b=0
while radius > 0.0
for a = 1 to 5
dy1 = sin(angle1) * radius
dx1 = cos(angle1) * radius
dy2 = sin(angle2) * radius
dx2 = cos(angle2) * radius

x1 = x + dx1 ; x2 = x + dx2
y1 = y + dy1 ; y2 = y + dy2
draw line int(x1),int(y1),int(x2),int(y2)

angle1 = angle1 + 72.0
angle2 = angle2 + 72.0
next

radius = radius - 0.001
b=b+1

wend

endproc


procedure Circle( x#, y#, size# , type )

angle# = 0.0; cnt = 1; distance# = size/ 2.0
x2 = int(x)
y2 = int(y)
size2 = int(size) ; size3 = int(size/ 2.0)
if type = 0 then draw ellipse x2,y2,size2,size2,0
if type = 1 then draw ellipse x2,y2,size2,size2,1
if type = 2
while cnt < 33

x3# = MoveX(x, distance, angle) ; y3# = MoveY(y, distance , angle)
x4 = int(x3) ; y4 = int(y3)
draw ellipse x4,y4,size3,size3,0

angle = angle + 11.25;
cnt = cnt + 1
wend

endif

endproc

 
procedure Circle8( x#, y#, size# , distance#, type)

angle# = 0.0; cnt = 1;
while cnt < 33

x2# = MoveX(x, distance, angle) ; y2# = MoveY(y, distance , angle)
proc Circle x2, y2, size, type ;

angle = angle + 11.25;
cnt = cnt + 1
wend
endproc

 
procedure Circle8x( x#, y#, size#, distance1#, distance2#, type)

angle1# = 0.0; cnt1 = 1; angle2# = 0.0; cnt2 = 1;
while cnt1 < 9

x2# = MoveX(x, distance1, angle1) ; y2# = MoveY(y, distance1 , angle1)
cnt2 = 1 ; angle2 = 0.0
while cnt2 < 9

x3# = MoveX(x2, distance2, angle2) ; y3# = MoveY(y2, distance2 , angle2)
proc Circle x3, y3, size, type ;

angle2 = angle2 + 45.0;
cnt2 = cnt2 + 1
 
wend

angle1 = angle1 + 45.0;
cnt1 = cnt1 + 1
wend

 
endproc

 
procedure Circle16( x#, y#, size# , distance#, type)

angle# = 0.0; cnt = 1;
while cnt < 17

x2# = MoveX(x, distance, angle) ; y2# = MoveY(y, distance , angle)
proc Circle x2, y2, size, type ;

angle = angle + 22.5;
cnt = cnt + 1
wend
endproc

 

procedure Circle32( x#, y#, size# , distance#, type)

angle# = 0.0; cnt = 1;
while cnt < 33

x2# = MoveX(x, distance, angle) ; y2# = MoveY(y, distance , angle)
proc Circle x2, y2, size, type ;

angle = angle + 11.25;
cnt = cnt + 1
wend
endproc

 
procedure Circle32a( x#, y#, size# , distance#, type)

angle# = 5.625 ; cnt = 1;
while cnt < 33 ;

x2# = MoveX(x, distance, angle) ; y2# = MoveY(y, distance , angle)
proc Circle x2, y2, size, type ;

angle = angle + 11.25;
cnt = cnt + 1
wend
endproc

 
procedure Circle180( x#, y#, size# , distance#, type)

angle# = 0.0; cnt = 1;
while cnt < 181

x2# = MoveX(x, distance, angle) ; y2# = MoveY(y, distance , angle)
proc Circle x2, y2, size, type ;

angle = angle + 2.0;
cnt = cnt + 1
wend
endproc

 

procedure Mandala()

' Outer background

set color 30,10,50
cls

 
angle# = 0.0; cnt = 1; x# = 600.0 ; y# = 350.0 ; size# = 40.0 ; d# = 100.0 ; angle2# = 22.5

' Middle Background

set color 0,50,180 ; proc Circle x, y, 350.0, 1 ;

' Center Background

set color 0,60,130 ; proc Circle x, y, 200.0, 1 ;

 

' More background lines

set color 0,40,60 ; proc Circle180 x, y, 80.0, 270.0, 0 ;

 
set color 0,170,150 ; proc Circle32 x, y, 60.0, 140.0, 0 ;

 
 
while cnt < 9

' 8 main angles Each angle is a reflection of the first angle.

' First group of eight objects

x2# = MoveX(x, 115.0, angle) ; y2# = MoveY(y, 115.0, angle) ;
 
set color 0,0,220 ; proc Circle x2, y2, 30.0, 1
set color 0,10,20 ; proc Circle x2, y2, 10.0, 0


proc Circle32 x2, y2, 10.0,20.0, 0 ;
proc Circle x2, y2, 25.0, 1 ; set color 200,0,255 ; proc Circle x2, y2, 25.0, 0 ;
set color 0,150,255 ; proc Circle32 x2, y2, 10.0,10.0, 0 ;

 

' Second

x2# = MoveX(x, 250.0, angle) ; y2# = MoveY(y, 250.0, angle)
set color 0,190,230 ; proc Circle x2, y2, 16.0, 1
set color 255,255,255 ; proc Circle x2, y2, 6.0, 1
set color 255,255,255 ; proc Circle x2, y2, 19.0, 0
set color 0,100,200 ; proc Circle32 x2, y2, 8.0,18.0, 0

 
 

' Third

x2# = MoveX(x, 320.0, angle) ; y2# = MoveY(y, 320.0, angle)
set color 0,255,250 ; proc Circle x2, y2, 16.0, 1
set color 255,255,255 ; proc Circle x2, y2, 19.0, 0
set color 0,100,200 ; proc Circle32 x2, y2, 8.0,18.0, 0

 
angle = angle + 45.0;
cnt = cnt + 1
wend

 
cnt = 1;
 
 

' alternate angles

while cnt < 9

' First group of 8 objects

x2# = MoveX(x, 190.0, angle2) ; y2# = MoveY(y, 190.0, angle2)
set color 0,00,90 ; proc Circle32 x2, y2, 30.0,30.0, 0

' Second group of 8 objects

x2# = MoveX(x, 310.0, angle2) ; y2# = MoveY(y, 310.0, angle2)
set color 255,255,255 ; proc Circle x2, y2, 40.0, 1
set color 0,55,200 ; proc Circle x2, y2, 20.0, 1
set color 0,195,255 ; proc Circle32 x2, y2, 26.0,26.0, 0


angle2 = angle2 + 45.0
cnt = cnt + 1
wend

' Ring of 32 objects drawn over everything else. x,y is center of mandala, Size of circle, distance from center, type of object 1= solid circle- 0 = line

set color 0,250,0 ; proc Circle32 x, y, 10.0, 190.0, 0
set color 255,255,255 ; proc Circle32 x, y, 6.0, 190.0, 1 ;

 

' Center Object

 
set color 255,255,255 ; proc Circle x, y, 40.0, 1 ;
set color 0,0,180 ; proc Circle x, y, 20.0, 1 ;
set color 0,155,255 ; proc Circle32 x, y, 30.0, 20.0, 0



endproc

 
 
 

end


RE: MandalaV3 - Rick3137 - 01-06-2020

In this version I have set up some object arrays to control the colors.

Code:
'  By Rick3137    http://rb23.yolasite.com/
'  You have permission to copy, paste, alter or post anywhere as long as you don't copyright my work.
'  If it breaks your computer or does damage to your health or wealth , I didn't do it.
'  If you repost this material to another website like Utube, please make changes to the content and name so no one gets confused.

visible:
'event = 1 ; mx = 0 ; my = 0
r1 = 0 ; g1 = 0 ;
 clr?[60]
' background colors
clr[0].red = 0 ; clr[0].green = 0 ; clr[0].blue = 0
clr[1].red = 0 ; clr[1].green = 10 ; clr[1].blue = 20
clr[2].red = 0 ; clr[2].green = 20 ; clr[2].blue = 40
clr[3].red = 0 ; clr[3].green = 50 ; clr[3].blue = 70
clr[4].red = 0 ; clr[4].green = 80 ; clr[4].blue = 120

clr[5].red = 0 ; clr[5].green = 150 ; clr[5].blue = 210
clr[6].red = 0 ; clr[6].green = 160 ; clr[6].blue = 200
clr[7].red = 0 ; clr[7].green = 170 ; clr[7].blue = 180
clr[8].red = 0 ; clr[8].green = 180 ; clr[8].blue = 160
clr[9].red = 0 ; clr[9].green = 190 ; clr[9].blue = 140
clr[10].red = 0 ; clr[10].green = 200 ; clr[10].blue = 120
' Center object
clr[11].red = 255 ; clr[11].green = 255 ; clr[11].blue = 255
clr[12].red = 0 ; clr[12].green = 0 ; clr[12].blue = 180
clr[13].red = 0 ; clr[13].green = 155 ; clr[13].blue = 255
clr[14].red = 0 ; clr[14].green = 0 ; clr[14].blue = 0
clr[15].red = 0 ; clr[15].green = 0 ; clr[15].blue = 0
' Ring1 32x
clr[16].red = 0 ; clr[16].green = 250 ; clr[16].blue = 0
clr[17].red = 255 ; clr[17].green = 255 ; clr[17].blue = 255
' Alternate Angle #1
clr[18].red = 200 ; clr[18].green = 0 ; clr[18].blue = 190
' Alternate angle #2
clr[19].red = 255 ; clr[19].green = 0 ; clr[19].blue = 55
clr[20].red = 155 ; clr[20].green = 0 ; clr[20].blue = 180
clr[21].red = 255 ; clr[21].green = 0 ; clr[21].blue = 155
clr[22].red = 0 ; clr[22].green = 0 ; clr[22].blue = 0
clr[23].red = 0 ; clr[23].green = 0 ; clr[23].blue = 0

' alternate angle #3
clr[24].red = 255 ; clr[24].green = 0 ; clr[24].blue = 55
clr[25].red = 0 ; clr[25].green = 0 ; clr[25].blue = 0
clr[26].red = 0 ; clr[26].green = 0 ; clr[26].blue = 0
clr[27].red = 0 ; clr[27].green = 0 ; clr[27].blue = 0
clr[28].red = 0 ; clr[28].green = 0 ; clr[28].blue = 0
clr[29].red = 0 ; clr[29].green = 0 ; clr[29].blue = 0

' main angle #1
clr[30].red = 0 ; clr[30].green = 15 ; clr[30].blue = 255
clr[31].red = 0 ; clr[31].green = 0 ; clr[31].blue = 50
clr[32].red = 0 ; clr[32].green = 170 ; clr[32].blue = 180
clr[33].red = 255 ; clr[33].green = 255 ; clr[33].blue = 255
clr[34].red = 0 ; clr[34].green = 150 ; clr[34].blue = 140
clr[35].red = 0 ; clr[35].green = 100 ; clr[35].blue = 120

' main angle #2
clr[36].red = 0 ; clr[36].green = 100 ; clr[36].blue = 200
clr[37].red = 255 ; clr[37].green = 255 ; clr[37].blue = 255
clr[38].red = 255 ; clr[38].green = 255 ; clr[38].blue = 255
clr[39].red = 0 ; clr[39].green = 100 ; clr[39].blue = 200
clr[40].red = 0 ; clr[40].green = 0 ; clr[40].blue = 0

' main angle #3
clr[41].red =90 ; clr[41].green = 0 ; clr[41].blue = 150
clr[42].red = 255 ; clr[42].green = 255 ; clr[42].blue = 255
clr[43].red = 0 ; clr[43].green = 100 ; clr[43].blue = 200
clr[44].red = 0 ; clr[44].green = 0 ; clr[44].blue = 0
clr[45].red = 0 ; clr[45].green = 0 ; clr[45].blue = 0

' main angle #4
clr[46].red = 255 ; clr[46].green = 255 ; clr[46].blue = 255
clr[47].red = 0 ; clr[47].green = 0 ; clr[47].blue = 0
clr[48].red = 0 ; clr[48].green = 0 ; clr[48].blue = 0
clr[49].red = 0 ; clr[49].green = 0 ; clr[48].blue = 0
clr[50].red = 0 ; clr[50].green = 0 ; clr[50].blue = 0





set redraw off

set window 0, 0, 1200, 700
  set color 0,0,10
  cls
  proc Mandala
  redraw
  wait keydown
end
hidden:
procedure Setup()

endproc

procedure PrintText()
     
     set caret 10,200
     write " MouseX = " ; wln str$(mx)
     write " MouseY = " ; wln str$(my)
     
endproc
        function MoveX#(x#, d#, angle#)
           x2# = 0.0;
           dx# = cos#( angle# )
           x2 = x + (dx * d);
           return x2;
        endfunc

        function MoveY#(y#, d#, angle#)
            y2# = 0.0;
            dy# = sin#( angle# )
            y2 = y - (dy * d);
            return y2;
        endfunc

      procedure DrawStar(x#, y#, size#)
          cnt = 1 ; angle# = 360.0
           x = x - size/2.0 ; y = y - size/6.0  
           x2# = x + size;
           y2# = y;
           
          while cnt < 6
             
               draw line int(x),int(y), int(x2), int(y2)
               angle = angle - 144.0
               x = x2; y = y2;
               x2# = MoveX(x, size, angle) ;  y2# = MoveY(y, size, angle)

               cnt = cnt + 1;
           wend
      endproc

      procedure DrawStar9(x#, y#, size#)
         z = 1
           x = x - size/2.0 ; y = y - size/6.0
        while z < 9
           cnt = 1 ; angle# = 360.0
 
           x2# = x + size;
           y2# = y;
          while cnt < 6
             
               draw line int(x),int(y), int(x2), int(y2)
               angle = angle - 144.0
               x = x2; y = y2;
               x2# = MoveX(x, size, angle) ;  y2# = MoveY(y, size, angle)

               cnt = cnt + 1;
           wend
           z = z + 1
           size = size - 1.0 ; cnt = 1
        '  x = x - size/2.0 ; y = y - size/6.0
          wend
      endproc

procedure DrawPentagon(x#,y#,radius#)
 x1#; y1#; x2#; y2#; angle1# ; dx1# ; dy1# ; angle2# ; dx2# ; dy2#
 angle1 = 54.0
 angle2 = angle1 + 72.0
 
 b=0
 while radius > 0.0
  for a = 1 to 5
    dy1 = sin(angle1) * radius
    dx1 = cos(angle1) * radius
    dy2 = sin(angle2) * radius
    dx2 = cos(angle2) * radius
    x1 = x + dx1 ; x2 = x + dx2
    y1 = y + dy1 ; y2 = y + dy2
    draw line int(x1),int(y1),int(x2),int(y2)
    angle1 = angle1 + 72.0
    angle2 = angle2 + 72.0
  next
  radius = radius - 0.001
  b=b+1
 
 wend
endproc
     
      procedure Circle( x#, y#, size# , type )
           angle# = 0.0; cnt = 1; distance# = size/ 2.0
          x2 = int(x)
          y2 = int(y)
          size2 = int(size) ; size3 = int(size/ 2.0)
          if type = 0 then draw ellipse x2,y2,size2,size2,0
          if type = 1 then draw ellipse x2,y2,size2,size2,1
          if type = 2
           while cnt < 33
               x3# = MoveX(x, distance, angle) ;  y3# = MoveY(y, distance , angle)
               x4 = int(x3) ; y4 = int(y3)
               draw ellipse x4,y4,size3,size3,0
           angle = angle + 11.25;
           cnt = cnt + 1
           wend
          endif
      endproc

      procedure Circle8( x#, y#, size# , distance#, type)
           angle# = 0.0; cnt = 1;  
           while cnt < 33
              x2# = MoveX(x, distance, angle) ;  y2# = MoveY(y, distance , angle)
              proc Circle  x2,  y2, size, type ;
           angle = angle + 11.25;
           cnt = cnt + 1
           wend
      endproc

      procedure Circle8x( x#, y#, size#, distance1#, distance2#, type)
           angle1# = 0.0; cnt1 = 1; angle2# = 0.0; cnt2 = 1;  
           while cnt1 < 9
              x2# = MoveX(x, distance1, angle1) ;  y2# = MoveY(y, distance1 , angle1)
                   cnt2 = 1 ; angle2 = 0.0
                   while cnt2 < 9
                      x3# = MoveX(x2, distance2, angle2) ;  y3# = MoveY(y2, distance2 , angle2)
                      proc Circle  x3,  y3, size, type ;
                      angle2 = angle2 + 45.0;
                      cnt2 = cnt2 + 1

                   wend
           angle1 = angle1 + 45.0;
           cnt1 = cnt1 + 1
           wend

      endproc

      procedure Circle16( x#, y#, size# , distance#, type)
           angle# = 0.0; cnt = 1;  
           while cnt < 17
              x2# = MoveX(x, distance, angle) ;  y2# = MoveY(y, distance , angle)
              proc Circle  x2,  y2, size, type ;
           angle = angle + 22.5;
           cnt = cnt + 1
      wend
      endproc

   
      procedure Circle32( x#, y#, size# , distance#, type)
           angle# = 0.0; cnt = 1;  
           while cnt < 33
              x2# = MoveX(x, distance, angle) ;  y2# = MoveY(y, distance , angle)
              proc Circle  x2,  y2, size, type ;
           angle = angle + 11.25;
           cnt = cnt + 1
      wend
      endproc

      procedure Circle32a( x#, y#, size# , distance#, type)
           angle# = 5.625 ; cnt = 1;
            while cnt < 33 ;
              x2# = MoveX(x, distance, angle) ;  y2# = MoveY(y, distance , angle)
              proc Circle  x2,  y2, size, type ;
           angle = angle + 11.25;
           cnt = cnt + 1
      wend
      endproc

      procedure Circle180( x#, y#, size# , distance#, type)
           angle# = 0.0; cnt = 1;  
           while cnt < 181
              x2# = MoveX(x, distance, angle) ;  y2# = MoveY(y, distance , angle)
              proc Circle  x2,  y2, size, type ;
           angle = angle + 2.0;
           cnt = cnt + 1
      wend
      endproc

procedure Mandala()
       ' Outer background
       set color  clr[0].red,clr[0].green,clr[1].blue  
       cls
   
    angle# = 0.0; cnt = 1; x# = 600.0 ; y# = 350.0 ; size# = 40.0 ; d# = 100.0 ; angle2# = 22.5
        ' Middle Background
    set color clr[1].red,clr[1].green,clr[1].blue ; proc Circle  x,  y, 350.0, 1 ;

        ' Center Background
    set color clr[2].red,clr[2].green,clr[2].blue  ; proc Circle  x,  y, 200.0, 1 ;

        ' More background lines
     set color clr[3].red,clr[3].green,clr[3].blue ; proc Circle180  x,  y, 80.0, 270.0, 0 ;

     set color clr[4].red,clr[4].green,clr[4].blue ; proc Circle32  x,  y, 60.0, 140.0, 0 ;

   
    while cnt < 9
      ' 8 main angles   Each angle is a reflection of the first angle.
      ' First group of eight objects
      x2# = MoveX(x, 115.0, angle) ;  y2# = MoveY(y, 115.0, angle) ;
     
        set color clr[30].red ,clr[30].green,clr[30].blue ; proc Circle  x2,  y2, 30.0, 1
        set color clr[31].red,clr[31].green,clr[31].blue  ;  proc Circle  x2,  y2, 10.0,0
        set color clr[32].red,clr[32].green,clr[32].blue ; proc Circle32  x2,  y2,  10.0,20.0, 0
        set color clr[33].red,clr[33].green,clr[33].blue ; proc Circle  x2,  y2, 10.0, 1
     
      ' Second
      x2# = MoveX(x, 250.0, angle) ;  y2# = MoveY(y, 250.0, angle)
       set color clr[36].red,clr[36].green,clr[36].blue ; proc Circle  x2,  y2, 16.0, 1
       set color clr[37].red,clr[37].green,clr[37].blue ; proc Circle  x2,  y2, 6.0, 1
       set color clr[38].red,clr[38].green,clr[38].blue ; proc Circle  x2,  y2, 19.0, 0
       set color clr[39].red,clr[39].green,clr[39].blue ; proc Circle32  x2,  y2,  8.0,18.0, 0


      ' Third
      x2# = MoveX(x, 320.0, angle) ;  y2# = MoveY(y, 320.0, angle)
      set color clr[41].red,clr[41].green,clr[41].blue  ; proc Circle  x2,  y2, 16.0, 1
      set color clr[42].red,clr[42].green,clr[42].blue  ; proc Circle  x2,  y2, 19.0, 0
      set color clr[43].red,clr[43].green,clr[43].blue  ; proc Circle32  x2,  y2,  8.0,18.0, 0

      angle = angle + 45.0;
      cnt = cnt + 1
    wend

     cnt = 1;


     ' alternate angles
    while cnt < 9
        ' First group of 8 objects  
          x2# = MoveX(x, 190.0, angle2) ;  y2# = MoveY(y, 190.0, angle2)
          set color clr[18].red,clr[18].green,clr[18].blue  ; proc Circle32  x2,  y2,  30.0,30.0, 0
         ' Second group of 8 objects
          x2# = MoveX(x, 310.0, angle2) ;  y2# = MoveY(y, 310.0, angle2)
          set color clr[19].red,clr[19].green,clr[19].blue  ; proc Circle  x2,  y2, 40.0, 1
          set color clr[20].red,clr[20].green,clr[20].blue  ; proc Circle  x2,  y2, 20.0, 1
          set color clr[21].red,clr[21].green,clr[21].blue  ; proc Circle32  x2,  y2,  26.0,26.0, 0

        angle2 = angle2 + 45.0
        cnt = cnt + 1
    wend
      ' Ring of 32 objects drawn over everything else.  x,y is center of mandala, Size of circle, distance from center, type of object 1= solid circle- 0 = line
      set color clr[16].red,clr[16].green,clr[16].blue ; proc Circle32  x,  y, 10.0, 190.0, 0 ;
      set color clr[17].red,clr[17].green,clr[17].blue ; proc Circle32  x,  y, 6.0, 190.0, 1 ;


      ' Center Object

      set color clr[11].red,clr[11].green,clr[11].blue ; proc Circle  x,  y, 40.0, 1 ;
      set color clr[12].red,clr[12].green,clr[12].blue ; proc Circle  x,  y, 20.0, 1 ;
      set color clr[13].red,clr[13].green,clr[13].blue ; proc Circle32  x,  y, 30.0, 20.0, 0

endproc



end