Advertisement
Rainulf

processing.js example 1

Oct 23rd, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. int X, Y;
  2. int rectloc = 100;
  3. int elliloc = 300;
  4.  
  5. void setup() {
  6. size(500, 500);
  7. background(#000000);
  8. //frameRate(10);
  9. //noStroke();
  10. }
  11.  
  12. void draw() {
  13.  
  14. background(#000000); // "redraws" the screen.
  15. text("Meow", 1, height-(height-11));
  16. // rect(X, Y, 55, 55);
  17. rect(rectloc, rectloc, 55, 55);
  18. if(X > rectloc && X < rectloc+55 && Y > rectloc && Y < rectloc+55) {
  19. int i = 10;
  20. while(i--) rect(random(500), random(500), 55, 55);
  21. }
  22.  
  23. ellipse(elliloc, elliloc, 55, 55);
  24. if(X > elliloc && X < elliloc+55 && Y > elliloc && Y < elliloc+55) {
  25. int i = 10;
  26. while(i--) ellipse(random(500), random(500), 55, 55);
  27. }
  28.  
  29. }
  30.  
  31. void mouseMoved( ) {
  32. X = mouseX;
  33. Y = mouseY;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement