Небольшой эффект, написанный Tronix на древнем компе, 8086+CGA
n=200
r.f=#PI*2/235
x.f=0
y.f=0
v.f=0
t.f=0.22
s=240/2
If InitSprite() And OpenWindow(0,0,0,640,480,"Bubble Universe",#PB_Window_SystemMenu) And OpenWindowedScreen(WindowID(0),0,0,640,480,0,0,0)
Repeat
StartDrawing(ScreenOutput())
Box (0,0,640,480,0)
For i=0 To n Step 2
For j=0 To n Step 2
u.f=Sin(i+v)+Sin(r*i+x)
v=Cos(i+v)+Cos(r*i+x)
x=u+t
;col=RGB(i*2,j*2,99)
col=RGB(i,j,n-(i+j)/2)
Box (320+u*s,240+v*s,2,2,col)
Next j
Next i
t+0.025
StopDrawing()
FlipBuffers()
Until WindowEvent()=#PB_Event_CloseWindow
EndIf
r.f=#PI*2/235
x.f=0
y.f=0
v.f=0
t.f=0.22
s=240/2
If InitSprite() And OpenWindow(0,0,0,640,480,"Bubble Universe",#PB_Window_SystemMenu) And OpenWindowedScreen(WindowID(0),0,0,640,480,0,0,0)
Repeat
StartDrawing(ScreenOutput())
Box (0,0,640,480,0)
For i=0 To n Step 2
For j=0 To n Step 2
u.f=Sin(i+v)+Sin(r*i+x)
v=Cos(i+v)+Cos(r*i+x)
x=u+t
;col=RGB(i*2,j*2,99)
col=RGB(i,j,n-(i+j)/2)
Box (320+u*s,240+v*s,2,2,col)
Next j
Next i
t+0.025
StopDrawing()
FlipBuffers()
Until WindowEvent()=#PB_Event_CloseWindow
EndIf
Комментарии
Отправить комментарий