Dark Bit Factory & Gravity

PROGRAMMING => Other languages => Yabasic => Topic started by: bikemadness on May 31, 2015

Title: nutting out starfield
Post by: bikemadness on May 31, 2015
I never got my head around programming this starfield business
here is left to right (my head hurts)
I'll post towards viewer version (much) later

Code: [Select]
open window 640,512
starfield=100
dim x(starfield)
dim y(starfield)
dim z(starfield)
for a=1 to starfield
x(a)=ran(620)+10
y(a)=ran(490)+10
z(a)=ran(4)+0.2
next a
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
for a=1 to starfield
x(a)=x(a)+z(a)
fill circle x(a),y(a),z(a)
if x(a)>640 x(a)=0
next a
until (1=0)
Title: Re: nutting out starfield
Post by: Hotshot on June 02, 2015
Nice Starfields there.....Short n sweet code :)