xxxxxxxxxx
89
let x = 2;
let y = 1;
let xjump = 1;
let yjump = 5;
let x2 = 1;
let y2 = 2;
let xjump2 = 5;
let yjump2 = 1;
let rectx;
let ry;
let num = 15.5;
function setup() {
createCanvas(600, 600);
background(90, 0, 0, 100);
textAlign(CENTER);
}
function draw() {
//colorMode(HSB);
// background(map(
// fill(
// map(mouseX, 0, width, 80, 10, 0);
// map(mouseY, 0, height, 1, 0, 0, )
// )
// ));
//* above is broken and I dont understand why (I had to look at my notes and it still broke)
colorMode(RGB);
fill(200, 60);
stroke(128, 0, 0, 10);
textSize(50);
text('Welcome to Hell', 290, 310);
fill(70, 0, 0);
stroke(45, 0, 0);
ellipse(x, y, random(1 - 10));
x = x + xjump;
if (x >= width || x <= 0) {
xjump = xjump * -1;
}
y = y + yjump;
if (y >= height || y <= 0) {
y = yjump + 1
}
fill(10);
ellipse(x2, y2, random(40 - 90))
x2 = x2 + xjump2;
if (x2 >= width || x2 <= 0) {
xjump2 = xjump2 * -1;
}
y2 = y2 + yjump2;
if (y2 >= height || y2 <= 0) {
y2 = yjump2 + 1
}
rectx = rectx + width / num
for (let ry = 0; ry < height; ry = ry + height / num) {
for (let rectx = 0; rectx < width; rectx = rectx + width / num) {
rect(rectx, ry, 20, 20);
fill(random(80), 0, 0, random(40));
}
}
}