Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //change framerate and thereby the speed of the squares to appear
- speed=30;
- alph=1;
- function setup() {
- createCanvas(600,500);
- background(0);
- frameRate(speed);
- }
- function draw() {
- x=random(1,width);
- y=random(1,height);
- r=map(x,0,width,0,255);
- b=map(x,0,width,255,0);
- //g=map(y,0,height,255,0);
- g=0;
- noStroke();
- fill(r,g,b,alph);
- rect(x,y,40,40);
- alph+=1/10;
- }
Advertisement
Add Comment
Please, Sign In to add comment