Created
September 25, 2017 22:49
-
-
Save bevchou/f5aaaf9f5741b2d0314bc5f0a8c3b8ee to your computer and use it in GitHub Desktop.
This file contains 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
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