// DREAMCATCHER demo

message "Dreamcatcher" "Stop"

// draw a 100 point ellipse and capture all the points..
pointlist startcapture
logo circpoints 100
ellipse 300 100
pointlist endcapture
pu

set npts = pointlist size

// now jump around between random points..
repeat untilbreak [

  if keypress = 1 [ break ]

  set ptnum = random :npts 
  set newpt = (point :ptnum)

  moveto (point :ptnum)
  pd
  circle 8 
  logo fillcolor = "red"
  fillshape 

  wait 10

  logo fillcolor = backcolor
  fillshape

  incr ptnum by 1
  if :ptnum > :npts [ set ptnum = 1 ]
  ]
