submission by jtoy
var objects=[]
function setup(){
  var myCanvas = createCanvas(windowWidth,windowHeight); //you must keep this line unmodified

  for(i=0;i<500;i++){ 
   xdir = int(random(0, 2)) - 1
   ydir = int(random(0, 2)) - 1
   x = random(width*2)
  y = random(height*2)
  s = random(5,20)
    o = {s:s,ydir:ydir,xdir:xdir,x:x,y:y,r:random(255),g:random(255),b:random(255)}
    objects.push(o)
  }
  x = 0;
  y = 0;
  
}

function draw() {

  
  //start writing your code here
  
  x = x + random(5)
  y = y + random(5)

  fill(0,255,0)
  rect(x,y,20,20);
  fill(255,0,0)
  rect(width-x,height-y,20,20);
  fill(255,0,255)
  rect(x,height-y,20,20);
  fill(0,255,255)
  rect(width-x,y,20,20);


  fill(12,12,12)

    for(i=0;i<objects.length;i++){ 
      o = objects[i]
      o['x'] = o['x'] + (random(5) * o['xdir'] )
      o['y'] = o['y'] + (random(5) * o['ydir'])
     fill(o['r'],o['g'],o['b'])
      rect(o['x'],o['y'],o['s'],o['s'])
    
    if(o['x'] > width*3 || o['y'] > height*3 ){
      o['x'] = width/2
      o['y'] = height/2
    }
   }
 objects[i] = o
rect(20,20,30,30)
  
}