Created
August 29, 2017 11:43
-
-
Save anonymous/dfa01a422a6d280711bf5f68425d0a6a to your computer and use it in GitHub Desktop.
Meda102 shared code
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
/** | |
* This function draws a target. | |
* It takes 2 parameters (x and y) which define | |
* the position of the target that is drawn. | |
* x: the distance in pixels from the top left | |
* y: the distance in pixels from the top right | |
**/ | |
void drawTarget(float x, float y) { | |
noStroke(); | |
for (int i = 0; i < 50; i = i + 5) { | |
if (i%2 == 0) { // this line says "if i is an even number then..." | |
fill(255); // fill in white | |
} else { // otherwise | |
fill(0); // fill in black | |
} | |
ellipse(x, y, 50 - i, 50 - i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment