function param1() return "interval", 10, 100, 50 end function main( x, y, p ) local w = bs_width_max() * (0.5 + 0.5*p) if w < 5 then w = 5 end if not firstDraw then local distance = bs_distance( lastDrawX - x, lastDrawY - y ) if distance < w*4 * bs_param1()/100 then return 0 end end local dx,dy = bs_dir() local nx,ny = bs_normal() local i local rad = 3.14159*2 / 10 for i = 0,4 do bs_polygon( bs_rotate( 1, 0, rad * i*2 ) ) bs_polygon( bs_rotate( 0.5, 0, rad * (i*2 + 1) ) ) end bs_polygon( bs_rotate( 1, 0, rad * 0 ) ) bs_polygon_mul( w, w ) bs_polygon_rotate( bs_atan( dx, dy ) ) bs_polygon_move( x, y ) local r,g,b = bs_forebg( 0.50 + 0.50*math.random() ) bs_fill( r,g,b, 255 ) lastDrawX = x lastDrawY = y firstDraw = false return 1 end lastDrawX = 0 lastDrawY = 0 firstDraw = true