xxxxxxxxxx
41
let Logo;
let x, y;
let vx, vy;
function setup() {
createCanvas(900,300);
Logo = loadImage("Logo.png");
x = random(height);
if(x > width - 60) x = 0;
y = random(width);
if(y > height - 40) y = 0;
vx = random(1, 4);
vy = random(1, 4);
CambiarColor()
}
function draw() {
//background(0,0,0);
image(Logo, x, y, 60, 40);
x = x + vx;
y = y + vy;
if( y > height - 40|| y < 0){
vy = -vy;
CambiarColor()
}
if( x > width - 60 || x < 0){
vx = -vx;
CambiarColor()
}
}
function CambiarColor(){
let Rojo = random(255);
let Azul = random(255);
let Verde = random(255);
tint(Rojo,Azul,Verde);
}