I haven't quite got the hang of them yet.
This program (long version) shows what I want.
open window 640,512
go=1
starz1=100
starz2=100
dim x1(starz1)
dim y1(starz1)
dim r1(starz1)
dim g1(starz1)
dim b1(starz1)
dim x2(starz2)
dim y2(starz2)
dim r2(starz2)
dim g2(starz2)
dim b2(starz2)
for a=1 to starz1
x1(a)=int(ran(64))*10
y1(a)=int(ran(51))*10
r1(a)=ran(256)
g1(a)=ran(256)
b1(a)=ran(256)
next a
for a=1 to starz2
x2(a)=int(ran(64))*10
y2(a)=int(ran(51))*10
r2(a)=ran(256)
g2(a)=ran(256)
b2(a)=ran(256)
next a
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
setrgb 1,20,20,20
fill rectangle 0,0 to 640,512
go=go+1
if go>50 go=1
if go>1 and go<25 then
for a=1 to starz1
y1(a)=y1(a)+1
if y1(a)>515 y1(a)=-3
setrgb 1,r1(a),g1(a),b1(a)
fill circle x1(a),y1(a),2
'dot x1(a),y1(a)
next a
endif
if go>25 and go<50 then
for a=1 to starz2
y2(a)=y2(a)+1
if y2(a)>515 y2(a)=-3
setrgb 1,r2(a),g2(a),b2(a)
fill circle x2(a),y2(a),2
'dot x2(a),y2(a)
next a
endif
until (1=0)
In the attempted short version, I'm not getting my random colours.
Can anyone see what I'm missing?
open window 640,512 rem >.
go=1
starz=3
stars=100
dim r(starz),g(starz),b(starz)
dim x(stars,starz),y(stars,starz)
for a=1 to starz
r(a)=ran(256)
g(a)=ran(256)
b(a)=ran(256)
for c=1 to stars
x(c,a)=int(ran(64))*10
y(c,a)=int(ran(51))*10
next c
next a
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
go=go+1
if go>75 go=1
setrgb 1,20,20,20
fill rectangle 0,0 to 640,512
for a=1 to starz
setrgb 1,r(a),g(a),b(a)
for c=1 to stars
y(c,a)=y(c,a)+1
if y(c,a)>515 y(c,a)=-3
if go>1 and go<25 fill circle x(c,1),y(c,1),2
if go>25 and go<50 fill circle x(c,2),y(c,2),2
if go>50 and go<75 fill circle x(c,3),y(c,3),2
next c
next a
until (1=0)
Help!