xxxxxxxxxx
1050
//Kim Rader MFA Thesis Kutztown University 2022
//Professor Josh Miller
let radio;
let positive;
let negative;
let neither;
let accepted;
let loving;
let excited;
let interested;
let confident;
let happy;
let afraid;
let sad;
let dislike;
let alone;
let angry;
let embarrassed;
let anxious;
let sleep;
let meal;
let water;
let exercise;
let outside;
let talk;
let submit;
let email;
let button;
let posaccepted;
let posloving;
let posexcited;
let posinterested;
let posconfident;
let poshappy;
let negafraid;
let negsad;
let negdislike;
let negalone;
let negangry;
let negembarrassed;
let mehindifferent;
let mehbored;
let mehnumb;
let mehwithdrawn;
let circles = true;
let squares = true;
let triangles = true;
let current;
let size = 90;
let space = 100;
let rows = 10;
let columns = 10;
let minS = 20;
// set this to true when you're done asking questions
let questions = true;
function setup() {
createCanvas(1080, 1080);
background(255);
strokeWeight(0);
textSize(18);
textStyle(BOLD);
//Question 1
radio = createRadio();
radio.option(1, "Good Day");
radio.option(2, "Bad Day");
radio.option(3, "Neither");
radio.style("width", "770px");
radio.position(10, 40);
//Question 2A
positive = createRadio();
positive.option(1, "Accepted/Valued");
positive.option(2, "Loving");
positive.option(3, "Excited");
positive.option(4, "Interested");
positive.option(5, "Confident");
positive.option(6, "Happy");
positive.style("width", "770px");
positive.position(10, 115);
positive.hide();
//Question 2B
negative = createRadio();
negative.option(1, "Afraid");
negative.option(2, "Sad");
negative.option(3, "Dislike");
negative.option(4, "Alone");
negative.option(5, "Angry");
negative.option(6, "Embarrassed");
negative.style("width", "770px");
negative.position(10, 115);
negative.hide();
//Question 2C
neither = createRadio();
neither.option(1, "Indifferent/Apathetic");
neither.option(2, "Bored");
neither.option(3, "Numb/Empty");
neither.option(4, "Withdrawn/Distant");
neither.style("width", "770px");
neither.position(10, 115);
neither.hide();
//Question 3A
accepted = createRadio();
accepted.option(1, "Needed/Wanted");
accepted.option(2, "Attractive");
accepted.option(3, "Loved");
accepted.option(4, "Cherished/Precious");
accepted.option(5, "Important/Esteemed");
accepted.option(6, "Popular/Admired");
accepted.option(7, "Cooperative/Helpful");
accepted.option(8, "Respected");
accepted.style("width", "700px");
accepted.position(10, 190);
accepted.hide();
//Question 3B
loving = createRadio();
loving.option(1, "Joyful");
loving.option(2, "Thankful");
loving.option(3, "Content");
loving.option(4, "Tolerant");
loving.option(5, "Caring");
loving.option(6, "Committed");
loving.option(7, "Accepting");
loving.option(8, "Humble");
loving.option(9, "Generous");
loving.style("width", "770px");
loving.position(10, 190);
loving.hide();
//Question 3C
excited = createRadio();
excited.option(1, "Amazed");
excited.option(2, "Surprised");
excited.option(3, "Energetic/Enthusiastic");
excited.option(4, "Aroused");
excited.option(5, "Moved");
excited.option(6, "Expectant");
excited.option(7, "Charged");
excited.style("width", "770px");
excited.position(10, 190);
excited.hide();
//Question 3D
interested = createRadio();
interested.option(1, "Sensitive/Responsive");
interested.option(2, "Intrigued");
interested.option(3, "Allured/Enticed");
interested.option(4, "Intimate/Romantic");
interested.option(5, "Attracted/Infatuated");
interested.option(6, "Creative/Inspired");
interested.option(7, "Curious");
interested.option(8, "Playful");
interested.style("width", "660px");
interested.position(10, 190);
interested.hide();
//Question 3E
confident = createRadio();
confident.option(1, "Trusting");
confident.option(2, "Positive");
confident.option(3, "Fearless");
confident.option(4, "Honest/Authentic");
confident.option(5, "Optimistic");
confident.option(6, "Bold/Brave");
confident.option(7, "Powerful");
confident.option(8, "Proud");
confident.style("width", "770px");
confident.position(10, 190);
confident.hide();
//Question 3F
happy = createRadio();
happy.option(1, "Joyful/Delighted");
happy.option(2, "Euphoric/Elated");
happy.option(3, "Cheerful/Playful");
happy.option(4, "Content/Satisfied");
happy.option(5, "Optimistic/Enthusiastic");
happy.option(6, "Peaceful/Tranquil");
happy.style("width", "700px");
happy.position(10, 190);
happy.hide();
//Question 3G
afraid = createRadio();
afraid.option(1, "Helpless");
afraid.option(2, "Threatened");
afraid.option(3, "Confused");
afraid.option(4, "Inferior/Insecure");
afraid.option(5, "Worried/Anxious");
afraid.option(6, "Stressed/Overwhelmed");
afraid.option(7, "Apprehensive/Nervous");
afraid.style("width", "700px");
afraid.position(10, 190);
afraid.hide();
//Question 3H
sad = createRadio();
sad.option(1, "Depressed");
sad.option(2, "Hurt");
sad.option(3, "Bereft/Inconsolable");
sad.option(4, "Melancholy/Sorrowful");
sad.option(5, "Subdued/Gloomy");
sad.option(6, "Aggrieved");
sad.option(7, "Discouraged");
sad.style("width", "800px");
sad.position(10, 190);
sad.hide();
//Question 3I
dislike = createRadio();
dislike.option(1, "Dismissive/Disdainful");
dislike.option(2, "Disgusted");
dislike.option(3, "Suspicious");
dislike.option(4, "Appalled");
dislike.option(5, "Repelled/Loathing");
dislike.option(6, "Skeptical/Disapproving");
dislike.style("width", "770px");
dislike.position(10, 190);
dislike.hide();
//Question 3J
alone = createRadio();
alone.option(1, "Distant/Withdrawn");
alone.option(2, "Lonely");
alone.option(3, "Excluded");
alone.option(4, "Fragile/Vulnerable");
alone.option(5, "Rejected/Friendless");
alone.option(6, "Desolate");
alone.style("width", "770px");
alone.position(10, 190);
alone.hide();
//Question 3K
angry = createRadio();
angry.option(1, "Offended/Insulted");
angry.option(2, "Indignant/Outraged");
angry.option(3, "Dismayed/Betrayed");
angry.option(4, "Bitter/Resentful/Jealous");
angry.option(5, "Frustrated/Annoyed");
angry.option(6, "Aggressive/Hostile");
angry.option(7, "Harassed/Persecuted");
angry.option(8, "Bored/Indifferent");
angry.option(9, "Rushed/Pressured");
angry.style("width", "770px");
angry.position(10, 190);
angry.hide();
//Question 3L
embarrassed = createRadio();
embarrassed.option(1, "Humiliated");
embarrassed.option(2, "Worthless");
embarrassed.option(3, "Guilty/Regret");
embarrassed.option(4, "Sheepish");
embarrassed.option(5, "Ashamed");
embarrassed.option(6, "Inferior");
embarrassed.style("width", "770px");
embarrassed.position(10, 190);
embarrassed.hide();
//Question 4
anxious = createSlider(1, 6, 0, 1);
anxious.position(10, 300);
anxious.style("width", "600px");
//Question 5
sleep = createSlider(1, 4, 0, 1);
sleep.position(10, 400);
sleep.style("width", "600px");
//Question 6
meal = createSlider(1, 6, 0, 1);
meal.position(10, 500);
meal.style("width", "600px");
//Question 7
water = createSlider(1, 5, 0, 1);
water.position(10, 600);
water.style("width", "600px");
//Question 8
exercise = createSlider(1, 4, 0, 1);
exercise.position(10, 700);
exercise.style("width", "600px");
//Question 9
outside = createRadio();
outside.option(1, "yes");
outside.option(2, "no");
positive.style("width", "600px");
outside.position(10, 800);
//Question 10
talk = createSlider(1, 4, 0, 1);
talk.position(10, 900);
talk.style("width", "600px");
// Email address
email = createInput();
email.position(10, 1000);
button = createButton("enter");
button.position(email.x + email.width, 1000);
//Submit button
submit = createButton("Submit");
submit.position(10, 1040);
submit.mousePressed(changeBG);
//set up color arrays
posaccepted = [
color("#df3163"),
color("#ef820c"),
color("#f9e29d"),
color("#9dc184"),
color("#9966cb"),
];
posloving = [
color("#d2203e"),
color("#fc607f"),
color("#ffe6b4"),
color("#ef820c"),
color("#ee2939"),
];
posexcited = [
color("#c6ea46"),
color("#effd5e"),
color("#fd6702"),
color("#fca3b7"),
color("#df3163"),
];
posinterested = [
color("#2aab88"),
color("#f8de7e"),
color("#faa600"),
color("#fa8073"),
color("#598baf"),
];
posconfident = [
color("#df3163"),
color("#fe6901"),
color("#ffe12a"),
color("#b5348b"),
color("#1135a7"),
];
poshappy = [
color("#fa8073"),
color("#fb812a"),
color("#ffe12a"),
color("#b068ee"),
color("#ff5bac"),
];
negafraid = [
color("#9dc184"),
color("#4f98a4"),
color("#fffdd0"),
color("#f5f5f5"),
color("#f0fff0"),
];
negsad = [
color("#4e516d"),
color("#1c2b51"),
color("#00796e"),
color("#3c3b3a"),
color("#7385a5"),
];
negdislike = [
color("#c6ea46"),
color("#4cba15"),
color("#23393a"),
color("#effd5e"),
color("#6f8238"),
];
negalone = [
color("#4e516d"),
color("#c0c0c0"),
color("#94c8da"),
color("#f9e29d"),
color("#d0f0c0"),
];
negangry = [
color("#fe6901"),
color("#c31708"),
color("#960119"),
color("#5e1913"),
color("#d4af36"),
];
negembarrassed = [
color("#fa8073"),
color("#ce5c5c"),
color("#ffe6b4"),
color("#fca3b7"),
color("#fbf0e6"),
];
mehindifferent = [
color("#f5f5f5"),
color("#c0c0c0"),
color("#d0f0c0"),
color("#7385a5"),
color("#565151"),
];
mehbored = [
color("#ffe4e1"),
color("#fdf5e6"),
color("#f4fffa"),
color("#eff8ff"),
color("#c0c0c0"),
];
mehnumb = [
color("#c0c0c0"),
color("#3c3b3a"),
color("#1c2b51"),
color("#0b0a0a"),
color("#4c5320"),
];
mehwithdrawn = [
color("#f0fff0"),
color("#c0c0c0"),
color("#7385a5"),
color("#23393a"),
color("#35272b"),
];
}
function keyPressed() {
// alert("SAVE");
saveCanvas();}
function draw() {
background(255);
if (questions == true) {
textSize(18);
textStyle(BOLD);
text("In general, how was your day today?", 10, 25);
text("How are you feeling right now?", 10, 100);
text("How anxious are you feeling today?", 10, 290);
text("Did you get enough sleep?", 10, 390);
text("Did you eat a healthy meal today?", 10, 490);
text("Did you drink water today?", 10, 590);
text("Did you move or exercise today?", 10, 690);
text("Have you been outside today?", 10, 790);
text("Have you talked or texted with family or friends today?", 10, 890);
text(
"Enter your email to save your artwork to a personal gallery",
10,
990
);
textSize(12);
textStyle(NORMAL);
//Question 4 slider labels
text("Calm/Relaxed", 10, 335);
text("Focused", 115, 335);
text("Distracted/Scattered", 200, 335);
text("Tense", 355, 335);
text("Stressed", 465, 335);
text("Overwhelmed", 550, 335);
//Question 5 slider labels
text("Exhausted", 10, 435);
text("Sleepy", 195, 435);
text("Well Rested", 380, 435);
text("Alert", 580, 435);
//Question 6 slider labels
text("nothing to eat", 10, 535);
text("nothing healthy", 95, 535);
text("1 healthy thing", 215, 535);
text("1 healthy meal", 330, 535);
text("2 healthy meals", 450, 535);
text("3 healthy meals", 570, 535);
//Question 7 slider labels
text("none", 10, 635);
text("1-2 cups", 140, 635);
text("3-4 cups", 290, 635);
text("5-6 cups", 435, 635);
text("7-8+ cups", 570, 635);
//Question 8 slider labels
text("Did not move at all", 10, 735);
text("Light movement", 175, 735);
text("Moderate movement", 360, 735);
text("Exercise/worked out ", 555, 735);
//Question 10 slider labels
text("No communication", 10, 935);
text("Text/email", 190, 935);
text("Phone/video", 380, 935);
text("In person", 580, 935);
//answers to Q1
if (radio.value() == 1) {
console.log("positive/circles");
positive.show();
negative.hide();
neither.hide();
circles = true;
squares = false;
triangles = false;
} else if (radio.value() == 2) {
console.log("negative/squares");
negative.show();
positive.hide();
neither.hide();
circles = false;
squares = true;
triangles = false;
} else if (radio.value() == 3) {
console.log("neither/triangles");
neither.show();
positive.hide();
negative.hide();
circles = false;
squares = false;
triangles = true;
}
//Answers to Q2
if (positive.value() == 1) {
console.log("Accepted/Valued");
textSize(18);
textStyle(BOLD);
text(
"How would you describe your feeling of acceptance and value?",
10,
175
);
current = posaccepted;
accepted.show();
loving.hide();
excited.hide();
interested.hide();
confident.hide();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (positive.value() == 2) {
console.log("Loving");
textSize(18);
textStyle(BOLD);
text("How would you describe your loving feeling?", 10, 175);
current = posloving;
accepted.hide();
loving.show();
excited.hide();
interested.hide();
confident.hide();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (positive.value() == 3) {
console.log("Excited");
textSize(18);
textStyle(BOLD);
text("How would you describe your excitement?", 10, 175);
current = posexcited;
accepted.hide();
loving.hide();
excited.show();
interested.hide();
confident.hide();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (positive.value() == 4) {
console.log("Interested");
textSize(18);
textStyle(BOLD);
text("How would you describe your interest?", 10, 175);
current = posinterested;
accepted.hide();
loving.hide();
excited.hide();
interested.show();
confident.hide();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (positive.value() == 5) {
console.log("Confident");
textSize(18);
textStyle(BOLD);
text("How would you describe your confidence?", 10, 175);
current = posconfident;
accepted.hide();
loving.hide();
excited.hide();
interested.hide();
confident.show();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (positive.value() == 6) {
console.log("Happy");
textSize(18);
textStyle(BOLD);
text("How would you describe your happiness?", 10, 175);
current = poshappy;
accepted.hide();
loving.hide();
excited.hide();
interested.hide();
confident.hide();
happy.show();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
}
if (negative.value() == 1) {
console.log("Afraid");
textSize(18);
textStyle(BOLD);
text("How would you describe your fear?", 10, 175);
current = negafraid;
afraid.show();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (negative.value() == 2) {
console.log("Sad");
textSize(18);
textStyle(BOLD);
text("How would you describe your sadness?", 10, 175);
current = negsad;
afraid.hide();
sad.show();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (negative.value() == 3) {
console.log("Dislike");
textSize(18);
textStyle(BOLD);
text("How would you describe your feeling of dislike?", 10, 175);
current = negdislike;
afraid.hide();
sad.hide();
dislike.show();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (negative.value() == 4) {
console.log("Alone");
textSize(18);
textStyle(BOLD);
text("How would you describe your loneliness?", 10, 175);
current = negalone;
afraid.hide();
sad.hide();
dislike.hide();
alone.show();
angry.hide();
embarrassed.hide();
} else if (negative.value() == 5) {
console.log("Angry");
textSize(18);
textStyle(BOLD);
text("How would you describe your anger?", 10, 175);
current = negangry;
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.show();
embarrassed.hide();
} else if (negative.value() == 6) {
console.log("Embarrassed");
textSize(18);
textStyle(BOLD);
text("How would you describe your embarrassment?", 10, 175);
current = negembarrassed;
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.show();
} else if (neither.value() == 1) {
console.log("Indifferent/Apathetic");
current = mehindifferent;
} else if (neither.value() == 2) {
console.log("Bored");
current = mehbored;
} else if (neither.value() == 3) {
console.log("Numb/Empty");
current = mehnumb;
} else if (neither.value() == 4) {
console.log("Withdrawn/Distant");
current = mehwithdrawn;
}
} else {
// draw all the pretty things here.
console.log ('anxious', (anxious.value()));
console.log ('sleep', (sleep.value()));
console.log ('healthy meal', (meal.value()));
console.log ('water', (water.value()));
console.log ('exercise', (exercise.value()));
console.log ('outside', (outside.value()));
console.log ('communicate', (talk.value()));
//circles - thanks to Roni Kauffman
if (circles == true) {
let n = 5;
let s = width / n;
let col1, col2;
console.log("circles true");
for (let x = 0; x < width; x += s) {
for (let y = 0; y < height; y += s) {
col1 = random(current);
fill(col1);
rect(x, y, s);
do {
col2 = random(current);
} while (col1 === col2);
fill(col2);
let r = random();
if (r < 1 / 2) {
r = random();
if (r < 1 / 4) {
arc(x, y, s * 2, s * 2, 0, PI / 2);
const d = width * 0.08;
shuffle(current, true);
patternColors(current);
pattern(PTN.stripeCircle(d / random(sleep.value())));
arcPattern(x, y, s * 2, s * 2, 0, PI / 2);
} else if (r < 1 / 2) {
arc(x + s, y, s * 2, s * 2, PI / 2, PI);
const d = width * 0.08;
shuffle(current, true);
patternColors(current);
pattern(PTN.dot(d / 10, (d / 10) * random(map(meal.value(), 1, 6, .2, 1))));
arcPattern(x + s, y, s * 2, s * 2, PI / 2, PI);
} else if (r < 3 / 4) {
arc(x + s, y + s, s * 2, s * 2, PI, (3 * PI) / 2);
const d = width * 0.08;
shuffle(current, true);
patternColors(current);
pattern(PTN.wave(d / random(water.value()), d / random(water.value())/5, d/5, d / 10));
arcPattern(x + s, y + s, s * 2, s * 2, PI, (3 * PI) / 2);
} else {
arc(x, y + s, s * 2, s * 2, (3 * PI) / 2, 0);
const d = width * 0.08;
shuffle(current, true);
patternColors(current);
pattern(PTN.stripeRadial(TAU / random(map(exercise.value(), 1, 4, 6, 30))));
arcPattern(x, y + s, s * 2, s * 2, (3 * PI) / 2, 0);
}
} else {
r = random();
if (r < 1 / 4) {
arc(x + s / 2, y, s, s, 0, PI);
} else if (r < 1 / 2) {
arc(x + s, y + s / 2, s, s, PI / 2, (3 * PI) / 2);
} else if (r < 3 / 4) {
arc(x + s / 2, y + s, s, s, PI, 0);
} else {
arc(x, y + s / 2, s, s, (3 * PI) / 2, PI / 2);
}
}
}
}
noLoop();
//squares - thanks to Okazz
} else if (squares == true) {
console.log("squares true");
noLoop();
background(0);
rectRec(0, 0, width, height);
//triangles - thanks to Zlosk
} else if (triangles == true) {
console.log("triangles true");
ellipseMode(CENTER);
background(255);
noStroke();
noLoop();
let n = 5;
tileWidth = width / n;
tileHeight = height / n;
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
switch (
int(random(9)) // choose random shape to draw
) {
case 0:
fn = DrawTriangleNW;
break;
case 1:
fn = DrawTriangleNE;
break;
case 2:
fn = DrawTriangleSW;
break;
case 3:
fn = DrawTriangleSE;
break;
case 4:
fn = DrawSquare;
break;
case 5:
fn = DrawTriangleNW;
break;
case 6:
fn = DrawTriangleNE;
break;
case 7:
fn = DrawTriangleSW;
break;
case 8:
fn = DrawTriangleSE;
break;
}
DrawShape(
fn,
i * tileWidth - 0.5,
j * tileHeight - 0.5,
tileWidth + 1,
tileHeight + 1
);
}
}
// saveCanvas();
}
function DrawShape(fn, x, y, w, h) {
fill(random(current));
fn(x, y, w, h);
}
function DrawCircle(x, y, w, h) {
fill(random(current));
ellipse(x + w / 2, y + h / 2, w, h);
}
function DrawCircleDonut(x, y, w, h) {
DrawDonut(DrawCircle, x, y, w, h);
}
function DrawDonut(fn, x, y, w, h) {
fn(x, y, w, h);
fn(x + 0.33 * w, y + 0.33 * h, 0.33 * w, 0.33 * h);
}
function DrawSquare(x, y, w, h) {
shuffle(current, true);
fill(random(current));
rect(x, y, w, h);
// const d = width * 0.08;
// patternColors(current);
// pattern(randPattern(d));
// rectPattern(x, y, w, h);
}
function DrawVert(fn, x, y, w, h) {
fn(x, y, w, h);
fn(x + 0.33 * w, y, 0.33 * w, h);
}
function DrawHorz(fn, x, y, w, h) {
fn(x, y, w, h);
fn(x, y + 0.33 * h, w, 0.33 * h);
}
function DrawTall(x, y, w, h) {
DrawVert(DrawSquare, x, y, w, h);
}
function DrawWide(x, y, w, h) {
DrawHorz(DrawSquare, x, y, w, h);
}
function DrawPlus(x, y, w, h) {
blendMode(MULTIPLY);
DrawHorz(DrawSquare, x, y, w, h);
DrawVert(DrawSquare, x, y, w, h);
}
function DrawSquareDonut(x, y, w, h) {
DrawDonut(DrawSquare, x, y, w, h);
}
function DrawTriangleNW(x, y, w, h) {
shuffle(current, true);
DrawTriangle(x, y, x, y + h, x + w, y);
const d = width * 0.08;
patternColors(current);
pattern(PTN.stripeCircle(d / random(sleep.value())));
trianglePattern (x, y, x, y+h, x+w, y);
}
function DrawTriangleNE(x, y, w, h) {
shuffle(current, true);
DrawTriangle(x + w, y, x, y, x + w, y + h);
const d = width * 0.08;
patternColors(current);
pattern(PTN.dot(d / 10, (d / 10) * random(map(meal.value(), 1, 6, .2, 1))));
trianglePattern(x + w, y, x, y, x + w, y + h);
}
function DrawTriangleSW(x, y, w, h) {
shuffle(current, true);
DrawTriangle(x, y + h, x + w, y + h, x, y);
const d = width * 0.08;
patternColors(current);
pattern(PTN.wave(d / random(water.value()), d / random(water.value())/5, d/5, d / 10));
trianglePattern(x, y + h, x + w, y + h, x, y);
}
function DrawTriangleSE(x, y, w, h) {
shuffle(current, true);
DrawTriangle(x + w, y + h, x + w, y, x, y + h);
const d = width * 0.08;
patternColors(current);
pattern(PTN.stripeRadial(TAU / random(map(exercise.value(), 1, 4, 6, 30))));
trianglePattern(x + w, y + h, x + w, y, x, y + h);
}
function DrawTriangle(x1, y1, x2, y2, x3, y3) {
fill(random(current));
beginShape();
vertex(x1, y1);
vertex(x2, y2);
vertex(x3, y3);
endShape();
}
}
}
function rectRec(x, y, w) {
let c = int(random(1, 4));
let sw = w / c;
let rnd = random(2);
let p = map(w, minS, width, 0, 1);
let corner = 0;
if (rnd < p) {
for (let i = 0; i < c; i++) {
for (let j = 0; j < c; j++) {
if (sw > minS) {
rectRec(x + i * sw, y + j * sw, sw);
} else {
fill(random(current));
rect(x + i * sw, y + j * sw, sw, sw, corner);
const d = width * 0.08;
patternColors(current);
pattern(PTN.noise(0.5));
rectPattern(x + i * sw, y + j * sw, sw, sw);
}
}
}
} else {
let off = 20;
let ww = w - off;
fill(random(current));
rect(x, y, w, w, corner);
if (ww > minS) {
rectRec(x + off / 2, y + off / 2, ww, ww);
}
}
}
function changeBG() {
radio.hide();
positive.hide();
negative.hide();
neither.hide();
accepted.hide();
loving.hide();
excited.hide();
interested.hide();
confident.hide();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
anxious.hide();
sleep.hide();
meal.hide();
water.hide();
exercise.hide();
outside.hide();
talk.hide();
submit.hide();
email.hide();
button.hide();
// record that we are done asking questions
questions = false;
}
// https://openprocessing.org/sketch/1278485
function randPattern(t) {
const ptArr = [
PTN.noise(0.5),
PTN.noiseGrad(0.4),
PTN.stripe(t / int(random(6, 12))),
PTN.stripeCircle(t / int(random(6, 12))),
PTN.stripePolygon(int(random(3, 7)), int(random(6, 12))),
PTN.stripeRadial(TAU / int(random(6, 30))),
PTN.wave(t / int(random(1, 3)), t / int(random(10, 20)), t / 5, t / 10),
PTN.dot(t / 10, (t / 10) * random(0.2, 1)),
PTN.checked(t / int(random(5, 20)), t / int(random(5, 20))),
PTN.cross(t / int(random(10, 20)), t / int(random(20, 40))),
PTN.triangle(t / int(random(5, 20)), t / int(random(5, 20))),
];
return random(ptArr);
}