Skip to content

Instantly share code, notes, and snippets.

Created August 31, 2017 01:31
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 anonymous/777ce364260b2c64cc2de4e0491a9300 to your computer and use it in GitHub Desktop.
Save anonymous/777ce364260b2c64cc2de4e0491a9300 to your computer and use it in GitHub Desktop.
/**
*This function will create two squares on top of one another.
*The squares will be a random size between 20 and 40 across and downwards.
*The squares will be the same colour but at a lower opacity so they can be seen.
*They look best when used in a grid with a space of 40 between the largest square that can be generated (40,40)
*/
void drawTwoRandomSquares(int across, int down){
noStroke();
fill(random(255), random(255), random (255), 100);
rect(across, down , random(20,40) , random(20,40));
rect(across, down, random(20,40), random(20,40));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment