Last active
October 15, 2015 13:23
-
-
Save jonesfish/d6257c4942b4a8c8fe8c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| PImage diamond = loadImage("img/diamond.png"); | |
| size(400,400); | |
| final int COUNT = 5; // 5 diamonds at a line | |
| float spacingX = width/COUNT; | |
| float spacingY = height/COUNT; | |
| float x = 0, y1 = 0, y2 = height-spacingY; | |
| for (int i=0; i<COUNT; i++){ | |
| x = i*spacingX; | |
| // 1st diamond | |
| image(diamond,x,y1); | |
| y1 += spacingY; | |
| // 2nd diamond | |
| image(diamond,x,y2); | |
| y2 -= spacingY; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment