   0                                      >>theta-d
   0                                      >>theta-dd
 
-  [ dup theta-dd>> abs 0.00001 < ]
-    [ -0.001 0.001 2random >>theta-dd ]
-    [ ]
-  while
+  [ 0.00001 theta-dd-small? ] [ -0.001 0.001 random-theta-dd ] [ ] while
 
   drop ;
 

  { 0.06 0.59 } stroke
  dup pos>>  point

  1 4 [a,b]
    [| dy |
      1 30 dy 6 * - 255.0 / 2array stroke
      dup pos>> 0 dy neg 2array v+ point
    ] with-locals
  each

  1 4 [a,b]
    [| dy |
      0 30 dy 6 * - 255.0 / 2array stroke
      dup pos>> dy v+y point
    ] with-locals
  each

  dup vel>> move-by

  dup
    [ speed>> ] [ theta>> { sin cos } <arr> ] bi n*v
  >>vel

  [ ] [ theta>>   ] [ theta-d>>  ] tri + >>theta
  [ ] [ theta-d>> ] [ theta-dd>> ] tri + >>theta-d
  [ ] [ speed>>   ] [ speed-d>>  ] tri * >>speed

  [ ] [ speed-d>> 0.9999 * ] bi >>speed-d

  ! 1000 random 996 >
  4/1000 chance
    [
      dup speed>> neg       >>speed
      dup speed-d>> neg 2 + >>speed-d

      ! 100 random 30 >
      70/100 chance
        [
          dim 2 / dup 2array >>pos
          collide
        ]
        [ drop ]
      if
    ]
    [ drop ]
  if ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! : draw ( -- )

!   boom>
!     [ particles> [ move ] each ]
!   when ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



  [ ] [ vel>> ] bi move-by

  turn

  step-theta
  step-theta-d
  step-speed-mul

  1000 random 997 >
    [
      dup speed>> neg    >>speed
      2 over speed-d>> - >>speed-d
    ]
  when

  out-of-bounds? [ collide ] [ drop ] if ;

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

