Author Topic: Star Bursts  (Read 1407 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
Star Bursts
« on: October 28, 2021 »
Early screen saver.

Code: [Select]
ang=pi/180
l=3
sp=5
bursts=12
stars=18
dim l(stars)
dim sp(stars)
dim b(stars)
dim x(stars)
dim y(stars)
dim a(stars)
dim R(stars)
dim G(stars)
dim B(stars)
dim burst(stars)
dim bursts(stars)

for c=1 to stars
b(c)=c
x(c)=int(ran(51))*10
y(c)=int(ran(64))*10
R(c)=int(ran(256))
G(c)=int(ran(256))
B(c)=int(ran(256))
burst(c)=360/bursts
next c

open window 640,512
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window

for c=1 to stars
b(c)=b(c)+1
setrgb 1,R(c),G(c),B(c)
for a=1 to bursts
fill circle cos(burst(c)*ang*a)*(b(c)*l)+y(c),sin(burst(c)*ang*a)*(b(c)*l)+x(c),3
fill circle cos(burst(c)*ang*(a+.5))*((b(c)*(l/2))+(sp/2))+y(c),sin(burst(c)*ang*(a+.5))*((b(c)*(l/2))+(sp/2))+x(c),2
next a

if b(c)*l>70 then
b(c)=0
x(c)=int(ran(51))*10
y(c)=int(ran(64))*10
endif
next c

until (1=0)
Have a Yahappy day.
I don't know what is wrong with the world - but I know how to fix it.