DoodleBot for SDLBasic


    What I  tried to do with this one, is to invent a new form of art medium. I am convinced that combining multiple fractals together could be turned into a new fad

that could be a new form of entertainment. I am trying it on several basic dialects.

   option explicit

  dim common red = rgb(255,0,0),blue = rgb(0,0,255),green = rgb(0,255,0),violet = rgb(255,0,255),yellow = rgb(255,255,0),bluegreen = rgb(0,255,255)
  dim common red2 = rgb(255,0,0),blue2 = rgb(255,0,0),green2 = rgb(255,0,0),violet2 = rgb(255,0,0),yellow2 = rgb(255,0,0),bluegreen2 = rgb(255,0,0)
  dim common black = rgb(0,0,0),white = rgb(255,255,255)

  dim common time1 = ticks()
  dim common time2 = 0

  autoback(-2)

   setdisplay( 800,600,32,1)

   ink ( black )

   cls   
   dim common Pi2=6.28318 , Type = 5 , Count = 0 , Count2 = 0
   dim common  Ang1 = Pi2/Type , Ang = 0 , x = 150 , y = 500 , Depth = 0
 
   ink (rgb(255,0,0))

 function SetColor( clr )
         if( clr = 0 ) then
          red = 0 : green = 0 : blue = 0
         end if
         if( clr = 1 ) then
          red = 255 : green = 200 : blue = 200
         end if
         if( clr = 2 ) then
          red = 255 : green = 0 : blue = 0
         end if
         if( clr = 3 ) then
          red = 255 : green = 200 : blue = 0
         end if
         if( clr = 4 ) then
          red = 255 : green = 255 : blue = 0
         end if
         if( clr = 5 ) then
          red = 0 : green = 255 : blue = 0
         end if
         if( clr = 6 ) then
          red = 0 : green = 0 : blue = 255
         end if
         if( clr = 7 ) then
          red = 255 : green = 0 : blue = 255
         end if
         if( clr = 8 ) then
          red = 200 : green = 200 : blue = 200
         end if
         if( clr = 9 ) then
          red = 255 : green = 255 : blue = 255
         end if
         if( clr = 10 ) then
          red = 100 : green = 100 : blue = 100
         end if
          if( clr = 11 ) then
          red = 200 : green = 180 : blue = 160
         end if
          if( clr = 12 ) then
          red = 200 : green = 0 : blue = 0
         end if
          if( clr = 13 ) then
          red = 200 : green = 160 : blue = 0
         end if
          if( clr = 14 ) then
          red = 200 : green = 200 : blue = 0
         end if
          if( clr = 15 ) then
          red = 0 : green = 200 : blue = 0
         end if
          if( clr = 16 ) then
          red = 0 : green = 0 : blue = 200
         end if
          if( clr = 17 ) then
          red = 200 : green = 0 : blue = 200
         end if
          if( clr = 18 ) then
          red = 150 : green = 0 : blue = 0
         end if
          if( clr = 19 ) then
          red = 0 : green = 150 : blue = 0
         end if
          if( clr = 20 ) then
          red = 0 : green = 0 : blue = 150
         end if
          if( clr = 21 ) then
          red = 100 : green = 0 : blue = 0
         end if
          if( clr = 22 ) then
          red = 0 : green = 100 : blue = 0
         end if
         if( clr = 23 ) then
          red = 0 : green = 0 : blue = 100  ' Jesus Is Comming
         end if
         ink ( rgb(red, green, blue))     
   
 end function
 function RotateLeft()
      Ang = Ang + Ang1
      if Ang > Pi2 then
       Ang = Ang - Pi2
   end if
   
 end function
 
 function MoveSteps ( distance )
       dim dx = cos(Ang) * distance
       dim dy = sin(Ang) * distance
       dim x2 = x + dx
       dim y2 = y - dy
        line( x,y,x2,y2)
        x = x2 : y = y2
 end function
  
 function Fractal(size)
          dim    cnt = 0
          Ang1 = Pi2/Type
         
          while cnt < Type
                         
             MoveSteps ( size )
             RotateLeft()
             cnt = cnt + 1
               if size > 50 then
                  Fractal(size/2)
               end if
              
          wend
 end function
 
  x = 400 : y = 300 : Ang = 0    
 
 Type = 5
 ink (blue)
 while ( Count2 < 40)
     Depth=0   
     Fractal(178)
     Count2 = Count2 + 1 :   Ang = Count2 * 3
     SetColor( Count2 )
     
  wend
 time2 = ticks() - time1
 
 text( 10,0,16,"Press any key to exit .." )
 text( 10,30,16,time2 )
 text( 60,30,16," ms. Drawing time ")
 screenswap
 waitkey
 end
































 
Make a Free Website with Yola.