offset method

Vec offset(
  1. int x,
  2. int y
)

Returns a new Vec whose coordinates are this one's translated by x and y.

Implementation

Vec offset(int x, int y) => Vec(this.x + x, this.y + y);