'#########################################################
' DOT TUNNEL Coded by Nick Simpson Aka Shockwave/Ftx
'#########################################################
open window 400,400
tunfad=-570
dr=360*3
rings=10
dim orgx(dr)
dim orgy(dr)
dim offx(rings)
dim offy(rings)
dim cirz(rings)
dim rotate(rings)

for a=1 to 1040 
   orgx(a)=25*sin(a*pi/180)
   orgy(a)=25*cos(a*pi/180)
next a
zst=1

for a=1 to rings
  offx(a)=320
  offy(a)=250
  cirz(a)=zst
  zst=zst+2
  rotate(a)=a
next a
t$="                                                                             "
t$=t$+"ANOTHER SILLY ROUTINE BY NICK IN AUGUST 2001...   "
t$=t$+"CONTACT ME: NICKSIMPSON007@AOL.COM"
t$=t$+" IF YOU LIKE TO CODE IN YABASIC TOO!!   THATS ALL."
t$=t$+"PS.. THE TUBE CONTAINS ABOUT 180 RECTANGLES AND "
t$=t$+"NEXT VERSION WILL BE IN FILLED 3D!!!!"
p=0
scx=10

label loop
  setrgb 1,50,0,155
  fill rectangle 100,40 to 540,70
  setrgb 1,255,255,255
  text 120,60,"DOT TUNNEL DEMO BY SHOCKWAVE OF FANATIX!"
text scx,450,mid$(t$,p,64)
scx=scx-2
if scx<0 p=p+1  
if scx<0 scx=scx+10
if p>len(t$) p=0

  if tunfad<0 tunfad=tunfad+1
   setdispbuf dw
   dw=1-dw
   setdrawbuf dw
   clear window
   gosub tunnel
goto loop

label tunnel
for b=1 to rings
setrgb 1,cirz(b)+tunfad,cirz(b)+tunfad,30*cirz(b)+tunfad
'change the stepsize to 10 to see it as i intended you to
for a=1 to 360 step 20 
tfx=(orgx(a+rotate(b))*cirz(b))+offx(b)
tfy=(orgy(a+rotate(b))*cirz(b))+offy(b)
   fill rectangle tfx,tfy to tfx+2+(cirz(b)),tfy+2+(cirz(b)) 
next a
next b
for a=1 to rings
  cirz(a)=cirz(a)+.1
  if cirz(a)>=20 gosub newpos
  rotate(a)=rotate(a)+3
next a

return

label newpos
tunsin=tunsin+.5
  cirz(a)=cirz(a)-20
  offx(a)=320+200*sin(tunsin/2)
  offy(a)=250+150*cos(tunsin)
  rotate(a)=0
return




