Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bevchou/f5aaaf9f5741b2d0314bc5f0a8c3b8ee to your computer and use it in GitHub Desktop.
Save bevchou/f5aaaf9f5741b2d0314bc5f0a8c3b8ee to your computer and use it in GitHub Desktop.
colorMode(HSL);
fill(h, s, l);
ellipse(a, b, 30, 30);
if (a >= width - 15 || a <= x + 30) {
directiona = -directiona;
h += random(20, 200);
}
if (b >= height - 15 || b <= 15) {
directionb = -directionb;
h -= random(20,70);
}
a += speeda * directiona;
b += speedb * directionb;
//reset color
if (h > 360){
h = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment