Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. /* Resizable stoplight
  2.    This is one possible solution to the resizable stoplight assignment.
  3.    Students could have their circles spaced differently, different color shades, or ???
  4.    It's the scalable feature that's important.
  5. */
  6.  
  7. //Black rectangular portion of the stoplight
  8. size(140,320);                  //Scales if the ratio of the canvas is maintained
  9. background(0);
  10. noStroke();
  11.  
  12. //red circle
  13. fill(255,0,0);
  14. ellipse(width/2,0.20 *height,height/4,height/4);
  15.  
  16. //yellow circle
  17. fill(255,255,0);
  18. ellipse(width/2,0.50 *height,height/4,height/4);
  19.  
  20. //green circle
  21. fill(0,255,0);
  22. ellipse(width/2,0.8*height,height/4,height/4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement