Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Resizable stoplight
- This is one possible solution to the resizable stoplight assignment.
- Students could have their circles spaced differently, different color shades, or ???
- It's the scalable feature that's important.
- */
- //Black rectangular portion of the stoplight
- size(140,320); //Scales if the ratio of the canvas is maintained
- background(0);
- noStroke();
- //red circle
- fill(255,0,0);
- ellipse(width/2,0.20 *height,height/4,height/4);
- //yellow circle
- fill(255,255,0);
- ellipse(width/2,0.50 *height,height/4,height/4);
- //green circle
- fill(0,255,0);
- ellipse(width/2,0.8*height,height/4,height/4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement