Created
September 9, 2014 06:06
-
-
Save nataliefreed/3026c6c40bde5d581197 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
//Art and Science of Computing Fall 14 | |
//Star decreases in size over time | |
//Click mouse to save a "screenshot" of its current state | |
int[] xPositions = { 90, 251, 51, 213, 151, 90 }; | |
int[] yPositions = { 230, 112, 112, 229, 39, 230 }; | |
float scaleSize = 1; | |
void setup() | |
{ | |
size(300, 300); | |
} | |
void draw() | |
{ | |
background(255); | |
scale(scaleSize); | |
beginShape(); | |
for(int i=0;i<xPositions.length;i++) | |
{ | |
vertex(xPositions[i], yPositions[i]); | |
} | |
endShape(); | |
scaleSize = scaleSize - 0.001; | |
} | |
void mousePressed() | |
{ | |
saveFrame("star.png"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment