Author Topic: ElectricArc  (Read 2028 times)

0 Members and 1 Guest are viewing this topic.

Aurel

  • Guest
ElectricArc
« on: April 25, 2015, 12:27:27 PM »
something for Peter to translate to o2  :D

Code: [Select]
'Freebasic
function 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 0
end function

screen 19,32,,64
do
    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 100
loop until len(inkey)
sleep
 

Peter

  • Guest
Re: ElectricArc
« Reply #1 on: April 26, 2015, 09:12:18 AM »
Aurel, your electric banana!


.
« Last Edit: April 26, 2015, 09:25:38 AM by Peter »

Aurel

  • Guest
Re: ElectricArc
« Reply #2 on: April 26, 2015, 09:37:46 AM »
Peter
that is a cool banana  ;D
thanks