Skip to content

Instantly share code, notes, and snippets.

@gtoast
Created November 26, 2013 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtoast/7664301 to your computer and use it in GitHub Desktop.
Save gtoast/7664301 to your computer and use it in GitHub Desktop.
Testing out the gist.
PShape shapeOut;
Ellipse[] shapesOut;
int numShapesOut = 10;
float scaleSpeed = 10;
float createSpeed = .05;
float fact = 1.0;
float centerX;
float centerY;
float lastEvent = 0;
Ellipse e;
void setup() {
size(800, 600);
frameRate(32);
smooth();
centerX = width/2;
centerY = height/2;
}
void draw() {
background(.03);
shapeMode(CENTER);
translate(mouseX, mouseY);
if (e == null && millis() - lastEvent >= 100) {
e = new Ellipse(0, 0, 1, 1);
lastEvent = millis();
}
if (e != null) {
e.draw(color(249, 255, 127));
e.setScale(e.getScale() + scaleSpeed);
if (e.getScale() > 800) {
e = null;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment