xxxxxxxxxx
88
let pics = [];
let x = 10;
let y;
let timer = true;
function preload() {
pics[0] = loadImage('images/1.png');
pics[1] = loadImage('images/0.png');
pics[2] = loadImage('images/2.png');
}
function setup() {
createCanvas(800, 800);
colorMode(HSB, 360,100,100,100);
background(180, 60, 100);
}
function draw() {
if(timer == true) {
rdCreate();
}
}
function rdCreate () {
let x = random(width);
let y = random(height);
let w = random(50,150);
let h = random(50,150);
tint(random(360), 153, 204)
image(random(pics),mouseX,mouseY,w,h);
}
function mousePressed () {
rdCreate();
timer = !timer;
}
function one() {
let w = random(0,windowWidth);
let h = random(0,windowHeight);
// fill(pics[0].get(mouseX,mouseY));
rect(w,h,3,5);
}
function two() {
let x = random(width);
let y = random(height);
let w = random(50,150);
let h = random(50,150);
image(random(pics),x,y,w,h);
}
setInterval(two, 500);
//setInterval(one, 1000);
//setInterval(three, 2000)