function param1() return "density", 5, 100, 50 end function param2() return "color rnd", 0, 100, 40 end function set_line( w, rot ) bs_polygon( 0.0, -0.05 ) bs_polygon( 0.2, -0.05 ) bs_polygon( 1.0, 0.0 ) bs_polygon( 0.2, 0.05 ) bs_polygon( 0.0, 0.05 ) bs_polygon( -0.2, 0.05 ) bs_polygon( -1.0, 0.0 ) bs_polygon( -0.2, -0.05 ) bs_polygon( 0.0, -0.05 ) bs_polygon_mul( w, w ) bs_polygon_rotate( rot ) end function main( x, y, p ) local w = bs_width_max() * 0.30 if w < 5 then w = 5 end if not firstDraw then local distance = bs_distance( lastDrawX - x, lastDrawY - y ) if distance < w/2 then return 0 end end local dx,dy = bs_dir() local nx,ny = bs_normal() local num = 20 * bs_param1() / 100 local i for i=0,num do set_line( w * (1.0 + math.random()), math.random()*2*3.14159 ) local px,py = bs_rotate( w * math.random(), 0, math.random()*2*3.14159 ) bs_polygon_move( x+px, y+py ) local r,g,b = bs_forebg( 1.0 - math.random()*bs_param2()/100 ) bs_fill( r,g,b, 255 ) end lastDrawX = x lastDrawY = y firstDraw = false return 1 end lastDrawX = 0 lastDrawY = 0 firstDraw = true