blitzbasic吧 关注:256贴子:1,024
  • 4回复贴,共1

简单的雷击

只看楼主收藏回复

Graphics 640,480,16,2
SetBuffer BackBuffer()
While Not KeyHit(1)
Cls
bolt(x1,y1,x2,y2,32,scale)
If timer<0
timer=100
x1=Rnd(640)
y1=Rnd(480)
x2=Rnd(640)
y2=Rnd(480)
scale=8+Rnd(16)
Else
timer=timer-1
EndIf
Color 255,255,255
Oval x1,y1,8,8
Oval x2,y2,8,8
Flip
Wend
End
Function bolt(bx1,by1,bx2,by2,s,bscale)
Color 90,90,255
x=bx2
y=by2
xstep=(bx1-bx2)/s
ystep=(by1-by2)/s
LockBuffer BackBuffer()
For i=1 To s-1
r1=Rnd(-bscale,bscale)
r2=Rnd(-bscale,bscale)
x2=(x+xstep)+r1
y2=(y+ystep)+r2
Line x,y,x2,y2
x=x2
y=y2
Next
Line x,y,bx1,by1
UnlockBuffer BackBuffer()
End Function


IP属地:河北1楼2013-02-08 20:49回复
    看了。。。学习中


    2楼2013-02-13 10:36
    回复
      请问 文件格式是什么


      IP属地:福建3楼2014-05-09 19:20
      收起回复