function main( x, y, p ) local w = bs_width() * .002 if firstDraw then lastDrawX = x lastDrawY = y scatterPointCount = bs_width_max() / 10 + 1 for i = 1 , scatterPointCount do local r1 = math.random() local rad1 = math.random() * 2 * math.pi scatterPointX[i] = r1 * math.cos(rad1) scatterPointY[i] = r1 * math.sin(rad1) end firstDraw = false return 0 else local distance = bs_distance( lastDrawX - x, lastDrawY - y ) if distance < w then return 0 end end local nx, ny = bs_dir() local rad2 = bs_atan(nx, ny) local line_count = bs_width() / 10 + 1 for i = 1, line_count do local r2 = bs_width_max() / 2 local sx = scatterPointX[i] * r2 local sy = scatterPointY[i] * r2 local sx2 = sx * math.cos(rad2) + sy * math.sin(rad2) local sy2 = sx *-math.sin(rad2) + sy * math.cos(rad2) bs_circle(x + sx2, y + sy2, w + 1, 0) end lastDrawX = x lastDrawY = y return 1 end function last(x, y, p) end lastDrawX = 0 lastDrawY = 0 scatterPointCount = 0 scatterPointX = {} scatterPointY = {} firstDraw = true