     @y = ry
 
   jitter: (amount) ->
-    @x += Random.float(-1, 1) * amount
-    @y += Random.float(-1, 1) * amount
+    @x += Math.random.float(-1, 1) * amount
+    @y += Math.random.float(-1, 1) * amount
     this
 
   jitter_: (amount) -> (new Vec2(@x, @y)).jitter amount

  equals: (v) -> @x is v.x and @y is v.y

  clone: -> new Vec2(@x, @y)

  toString: -> "Vec2[" + @x + "," + @y + "]"


module.exports =
  Vec2: Vec2
  set: (v) -> @x = v.x; @y = v.y; this
  set2: (x, y) -> @x = x; @y = y; this

  zero: -> @x = @y = 0; this

  add: (v) -> @x += v.x; @y += v.y; this
  add_: (v) -> new Vec2(@x + v.x, @y + v.y)
