Latest OxygenBasic.zip at GitHub (Click on the Wizard)
0 Members and 1 Guest are viewing this topic.
'Freebasicfunction drawLightning(x1 as integer ,y1 as integer,x2 as integer,y2 as integer,displace as integer) as integer dim as integer curdetail=5 if (displace < curDetail) then thickline(x1,y1,x2,y2,2,rgb(200,200,255)) else var mid_x = (x2+x1)/2 var mid_y = (y2+y1)/2 mid_x += (rnd-.5)*displace mid_y += (rnd-.5)*displace drawLightning(x1,y1,mid_x,mid_y,displace/2) drawLightning(x2,y2,mid_x,mid_y,displace/2) end if return 0end functionscreen 19,32,,64do screenlock line(0,0)-(799,599),rgba(0,0,0,150),bf circle(25,300),25,rgb(100,100,100),,,,f circle(775,300),25,rgb(100,100,100),,,,f drawlightning(50,300,750,300,400) screenunlock sleep 100loop until len(inkey)sleep