Advertisement
otorp2

p5 array

Jun 4th, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. var circle = [100, 200, 300, 400];
  2. var boop = 0;
  3.  
  4. function setup() {
  5. createCanvas(500, 500);
  6.  
  7.  
  8. }
  9.  
  10. function draw() {
  11. background(255);
  12. fill (50,100,200);
  13. rect(circle[boop], 250, 100, 100);
  14. }
  15.  
  16. function mousePressed() {
  17. boop = boop + 1;
  18. if(boop > 3){
  19. boop = 0;
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement