Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1.  
  2. function setup(){
  3. // executed once
  4. createCanvas(windowWidth, windowHeight);
  5. background(80);
  6. fill(70);
  7. rect(width/2, 0, width/2, height);
  8. }
  9.  
  10.  
  11. function draw(){
  12. // executed all the time
  13.  
  14.  
  15. for(var x = 0; x < width; x+=10) {
  16. for(var y = 0; y < height; y+=10){
  17. if (x < width/2) {
  18. if (mouseX < width/2){
  19. stroke(255, 80, 80);
  20. } else {
  21. stroke(0);
  22. }
  23. } else {
  24. if (mouseX > width/2){
  25. stroke(80, 255, 80);
  26. } else {
  27. stroke(255);
  28. }
  29. }
  30.  
  31. strokeWeight(4);
  32. point(x,y);
  33. }
  34. }
  35.  
  36. }
  37.  
  38.  
  39. function windowResized(){
  40. resizeCanvas(windowWidth, windowHeight);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement