Last active
August 29, 2015 14:06
-
-
Save nataliefreed/830899c8286588e3f078 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
void setup() | |
{ | |
size(300, 300); | |
//position and draw two triangles in different places | |
drawMyTriangle(10, 10); | |
drawMyTriangle(50, 50); | |
} | |
void draw() | |
{ | |
//Remove the // from the line of code below to see what happens when you draw a new white background at the start of every frame | |
//background(255); | |
//draw triangles at a y-position of 100, at a random x-position | |
drawMyTriangle(int(random(0, width)), 100); | |
} | |
void drawMyTriangle(int x, int y) | |
{ | |
triangle(x+0, y+20, x+20, y+0, x+40, y+20); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment