// SPINNER - make an ellipse and change its size 
// to give the illusion of 3-D spin effect...

// these variables can be played with...
set size = 200
set color1 = "brightblue"
set jump = 3
logo animation
// logo circrotate 23


message "Spinner uses 'sine' \n for a realistic rotate effect.." "Stop"

set sizefactor = calc (:size / 100)  // since sine is based on 100
logo linecolor = :color1
set i = 0   
set ichg = :jump    
repeat untilbreak [
   if keypress = 1 [ break ]

   incr i by :ichg
   if :i >= 100  [ set ichg = (calc :jump * -1) ]
   if :i < 0 [ set ichg = :jump ]

   set w = sine calc (:i + 100)
   set w = calc (:w * :sizefactor)

   // draw the ellipse
   ellipse :w :size

   wait 3

   // erase the ellipse
   logo linecolor = "lightgray"
   ellipse :w :size
   logo linecolor = :color1
   ]
