Created
March 25, 2016 08:32
-
-
Save exnihilodub/6230ab72ba12f419c838 to your computer and use it in GitHub Desktop.
DBC class / motion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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