       difference = Vector.subtract(MOUSE.pos, particle.pos)
       dist = Math.max(difference.mag(), 1)
       
-      push_force = -1000000 
+      push_force = -1000 
       vel_mag = push_force / dist
       particle.vel.plus(Vector.unit(difference).s_mult(vel_mag))
 
   draw: =>
-    start = Date.now()
+    while window.performance.now() > @tick
+      for particle in @particles
+        particle.update(@canvas, ctx, 1)
+      @tick += @MS_PER_TICK
+
     ctx = @canvas.getContext("2d")
     ctx.globalCompositeOperation = 'source-over'
-    ctx.fillStyle = "rgba(0, 0, 0, #{255 * 1.5 * @tick})"
+    ctx.fillStyle = "rgba(0, 0, 0, 128)"
     ctx.fillRect(0, 0, @canvas.width, @canvas.height)
     #ctx.clearRect(0, 0, @canvas.width, @canvas.height)
-
     for particle in @particles
-      particle.update(@canvas, ctx, @tick)
       particle.draw(ctx)
-
-    end = Date.now()
-    @tick = (Math.max(end - start, 1)) / 1000.0
 
     window.requestAnimationFrame(@draw)
 

    ctx.restore()

class Animator
  constructor: (canvas) ->
    @$canvas = canvas
    @canvas = @$canvas[0]
    @$canvas.mousemove(@update_mouse_pos)
    @$canvas.mousedown(@explode_particles)
    @particles = @generate_particles(50)
    @tick = .001

  generate_particles: (num) ->
    colors = ['#FF5454', '#FF904A', '#FFCD57', '#FFFC85', '#FFF']

      @pos.y = Math.min(Math.max(@pos.y, 0), canvas.height)
      @vel.y = -@vel.y * 0.5

    @mass = Math.min(Math.max(@vel.mag()/1, 0.1), 1)

  draw: (ctx) =>
    ctx.save()
