Re: TIB: Stars


[Prev][Next][Index][Thread]

Re: TIB: Stars




This syntax may not work, but I've already done what you are trying, so
I'll show you what I did...

Btw, I messed up and am not typing this over.  Change pxl to Pt...

:Lbl A
:randInt(1,10,5)->A
:randInt(1,10,5)->E
:pxl-on(A,E
:randInt(-1,-10,5)->B
:pxl-on(B,C
:pxl-off(A,E
:randInt(-1,-10,5)->C
:pxl-on(C,B
:pxl-off(B,C
:pxl-on(A,B
:For(X,5:End
:pxl-off(A,B
:pxl-on(B,E
:For(X,5:End
:Goto A

To slow it down add "For(X,20):End".  THe larger the number where 20 is,
the longer, and the smaller the shorter

>I am trying to write a program like the starfield screen saver in
>Windows.  Here is what I have so far:  (this is in 85basic)
>
>/program Stars/
>:ZStd
>:randM(1,8/->/X     ;These line creates a random matrix that is 8
>:x(1,1/->/A         ;elements long.  It has integers from -10 to 10,
>:x(1,2/->/B         ;so you don't have to do the "int(10(rand-rand))"
>:x(1,3/->/C         ;thing to get numbers in that range.
>:x(1,4/->/D
>:x(1,5/->/E
>:x(1,6/->/F
>:x(1,7/->/G
>:x(1,8/->/H
>:ClDrw
>:lbl A
>:For(X,0,2,.1
>:PtOn(x*A,x*B
>:PtOn(x*C,x*D
>:PtOn(x*E,x*F
>:PtOn(x*G,x*H
>:PtOn(x*B,x*A
>:PtOn(x*D,x*C
>:PtOn(x*F,x*E
>:PtOn(x*H,x*G
>:For(Y,1,50:End
>:PtOff(x*A,x*B
>:PtOff(x*C,x*D
>:PtOff(x*E,x*F
>:PtOff(x*G,x*H
>:PtOff(x*B,x*A
>:PtOff(x*D,x*C
>:PtOff(x*F,x*E
>:PtOff(x*H,x*G
>:End
>:Goto A
>/end/
>
>I want to speed up this program.  I would also like to get some more
>stars on screen.  Any ideas?
>
>
>==
>Garth Johnson
>
>_________________________________________________________
>DO YOU YAHOO!?
>Get your free @yahoo.com address at http://mail.yahoo.com