Skip to content

Instantly share code, notes, and snippets.

@claytical
Created September 15, 2015 00:58
Show Gist options
  • Save claytical/b35959756eee29619736 to your computer and use it in GitHub Desktop.
Save claytical/b35959756eee29619736 to your computer and use it in GitHub Desktop.
Conditional Statement Comparison Example
var y;
function setup() {
createCanvas(windowWidth, windowHeight);
y = 0;
}
function draw() {
background(0);
ellipse(width/2, y, 50, 50);
if (y > height) {
y = 0;
}
y = y + 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment