nick34992
4/20/2016 - 5:48 PM

PVector Cornered. Using Processing.js Library.

PVector Cornered. Using Processing.js Library.

PVector l = new PVector(576, 324);
PVector v = new PVector(16, 9);

void setup() {
  size(896, 504);
}

void draw() {
  background(255);
  l.add(v);
  if ((l.x > width) || (l.x < 0)) {
    v.x = v.x * -1;
  }
  if ((l.y > height) || (l.y < 0)) {
    v.y = v.y * -1;
  }
  noStroke();
  fill(255, 0, 0);
  ellipse(l.x, l.y, 100, 100);
  frameRate(30);
}