Dark Bit Factory & Gravity
PROGRAMMING => Other languages => Yabasic => Topic started by: bikemadness on August 01, 2007
-
This is one of my early experiments. Simple, now - but still pretty.
Had to make it emulator friendly.
X to change shape
open window 640,512
ang=pi/180
x=320
y=260
doilys=10
dim points(doilys),dir(doilys),gap(doilys)
dim ra(doilys),r(doilys),g(doilys),b(doilys)
for c=1 to doilys
points(c)=int(ran(37))+3
dir(c)=360/points(c)
gap(c)=int(ran(points(c)/2))-1
ra(c)=ran(200)+50
r(c)=ran(256)
g(c)=ran(256)
b(c)=ran(256)
next c
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
d=peek("port1")
for c=1 to doilys
if and(d,16384)>0 then
points(c)=int(ran(37))+3
dir(c)=360/points(c)
gap(c)=int(ran(points(c)/2))-1
ra(c)=ran(200)+50
r(c)=ran(256)
g(c)=ran(256)
b(c)=ran(256)
endif
setrgb 1,r(c),g(c),b(c)
for a=1 to points(c)
line cos(dir(c)*a*ang)*ra(c)+x,sin(dir(c)*a*ang)*ra(c)+y to cos(dir(c)*(a+gap(c))*ang)*ra(c)+x,sin(dir(c)*(a+gap(c))*ang)*ra(c)+y
next a
next c
until (1=0)
Have a Yahappy day.
-
Nice work Bike!
-
Looks nice :) It would be really easy to fake a rotation here too by varying either the x or y radius and adding some offset to the circles formula.
-
hehe sometimes it looks like an eye this is really sweet