Skip to content

Instantly share code, notes, and snippets.

@exnihilodub
Created March 25, 2016 08:32
Show Gist options
  • Select an option

  • Save exnihilodub/6230ab72ba12f419c838 to your computer and use it in GitHub Desktop.

Select an option

Save exnihilodub/6230ab72ba12f419c838 to your computer and use it in GitHub Desktop.
DBC class / motion
import de.looksgood.ani.*;
void setup() {
size(512, 512);
smooth();
noStroke();
Ani.init(this);
}
float x =0;
float y =0;
void draw() {
background(255);
//fill(0);
ellipse(x, y, 120, 120);
}
void mouseMoved() {
Ani.to(this, 1.5, "x", mouseX, Ani.ELASTIC_OUT);
Ani.to(this, 1.5, "y", mouseY, Ani.ELASTIC_OUT,"onEnd:changeColor");
}
void changeColor() {
fill(random(255), random(255), random(255));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment