Author Topic: nutting out starfield  (Read 2723 times)

0 Members and 1 Guest are viewing this topic.

Offline bikemadness

  • Amiga 1200
  • ****
  • Posts: 312
  • Karma: 25
  • Hard players don't go home.
    • View Profile
nutting out starfield
« 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)
Have a Yahappy day.
I don't know what is wrong with the world - but I know how to fix it.

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: nutting out starfield
« Reply #1 on: June 02, 2015 »
Nice Starfields there.....Short n sweet code :)