// TRACER is included by other programs to get an animation effect like a shooting star..
// Operates on the current pointlist.
// 
// finalblue determines the color at which "fading" stops.. use 0 for black; use 60 for "darkblue"

to tracer :circlesize :finalblue

logo animation     /// disable printing

set npts = pointlist size
decr npts by 1
set blueval = 100
set i = 1
logo linecolor = backcolor
repeat :npts [
  logo fillcolor = "white"
  pu; moveto point :i
  pd; circle :circlesize
  fillshape
  if :i > 1 [
    logo fillcolor = 0 0 :blueval
    pu; moveto point (calc :i - 1)
    pd; circle :circlesize
    fillshape
    ]
  incr i by 1
  wait 1
  ]
pu; moveto point :npts
logo fillcolor = 0 0 :blueval
pd; circle :circlesize
fillshape

// now make it fade away..
repeat untilbreak [
  decr blueval by 4
  if :blueval < :finalblue [ break ] 
  logo fillcolor = 0 0 :blueval
  set i = 1
  repeat :npts [
    pu; moveto point :i
    pd; circle :circlesize
    fillshape
    incr i by 1
    ]
  wait 6
  ]

end

demo sayc "see the meteorshower demo"
