// Cloned by Mathias Bazin on 27 Jun 2018 from World "The Game of Life using P5 " by Mathias Bazin
// Please leave this clone trail here.
// Customise AB run parameters (optional).
// The following parameters can be customised. (They have default values.)
AB.clockTick = 20;
// Speed of run: Step every n milliseconds. Default 100.
AB.maxSteps = 65545;
// Length of run: Maximum length of run in steps. Default 1000.
AB.screenshotStep = 300;
// For automatic generation of World images.
// Take screenshot on this step. (All resources should have finished loading.) Default 50.
let x = 10, y = 150;
function setup()
{
createCanvas($(document).width(), $(document).height());
//before draw()
}
function draw()
{
//draw each step/frame
fill(random(255), random(255), random(255));
rect(x,y,45,90);
x+=3;
y+=3;
if(x>$(document).width()) x = -50;
if(y>$(document).height()) y = -100;
}