-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path1264.bas
More file actions
54 lines (52 loc) · 1.58 KB
/
Copy path1264.bas
File metadata and controls
54 lines (52 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'aquarium v2.bas SmallBASIC Bpf 2015-10-15 MGA/B+
'v2 the plasma color is set at initialization and stays with fish
'v2 the fish swim and are drawn both ways
option base 1
n=30
dim x(n),y(n),l(n),dx(n),dy(n),rr(n),gg(n),bb(n)
for i=1 to n
x(i)=rnd*xmax:y(i)=rnd*ymax:l(i)=rnd*xmax*.0625+18
d=int(rnd*2)
if d then dx(i)=rnd*8+1 else dx(i)=-1*(rnd*8)-1
r+=.2:g+=.005:b+=.010
if r>.5 then r=.02
if g>.5 then g=.005
if b>.5 then b=.01
rr(i)=r:gg(i)=g:bb(i)=b
next
while 1
for i=0 to ymax
line 0,i,xmax,i,rgb(0,0,255-(i/ymax)*255)
next
for i=1 to n
x(i)=x(i)+dx(i)
if x(i)+1.25*l(i)<0 then dx(i)=-1*dx(i)
if x(i)-1.25*l(i)>xmax then dx(i)=-1*dx(i)
y(i)=y(i)+int(rnd*5)-2
for ra=1 to l(i)
plasma=RGB(127+127*sin(rr(i)*ra),127+127*sin(gg(i)*ra),127+127*sin(bb(i)*ra))
if dx(i)<0 then
line x(i)+ra,y(i)-ra,x(i)+ra,y(i)+ra,plasma
else
line x(i)-ra,y(i)-ra,x(i)-ra,y(i)+ra,plasma
end if
next
for ra=5 to .3*l(i)
plasma=RGB(127+127*sin(rr(i)*ra),127+127*sin(gg(i)*ra),127+127*sin(bb(i)*ra))
if dx(i)<0 then
line x(i)+l(i)+ra,y(i)-ra,x(i)+l(i)+ra,y(i)+ra,plasma
else
line x(i)-l(i)-ra,y(i)-ra,x(i)-l(i)-ra,y(i)+ra,plasma
end if
next
if dx(i)<0 then
circle x(i)+.25*l(i),y(i),.1*l(i),1,0 filled
circle x(i)+.25*l(i),y(i),.06*l(i),1,14
else
circle x(i)-.25*l(i),y(i),.1*l(i),1,0 filled
circle x(i)-.25*l(i),y(i),.06*l(i),1,14
end if
next
delay 10
showpage
wend