xxxxxxxxxx
52
let x = 2;
let y = 2;
let xJump = 1.45;
let yJump = 2.45;
let z = 0.3*x
let w = 0.3*y
function setup() {
createCanvas(400, 400);
background(0);
smooth(10);
// noStroke();
stroke(3);
}
function draw() {
colorMode(HSB);
fill(
map(mouseY, 0, width, 0, 360), 100,
map(mouseY, 0, height, 0, 360), 100, 360);
rect(x, y,
map(mouseX, 0, height, 0, 180),
map(mouseX, 0, height, 0, 180),10);
ellipse(x, y,
map(mouseX, 0, width, 0, 100),
map(mouseX, 0, width, 0, 100));
y = y + yJump
x = x + xJump
if (x >= width) {
xJump = xJump * -1
}
if (y >= height) {
yJump = yJump * -1
}
if (x <= 0) {
xJump = xJump * -1
}
if (y <= 0) {
yJump = yJump * -1
}
}
function mousePressed() {
filter(INVERT, 5);
}