forked from Snap-Engineering-Academy-2021/p5-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
42 lines (34 loc) · 957 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
let colorlist = ['gold', 'black', 'turquoise', 'red'];
let img;
let fun = ['dance', 'play', 'drink', 'sleep', 'fun', 'work', 'school', 'love'];
let food = ['pizza', 'burgers', 'tacos', 'ramen', 'seafood', 'curry', 'wings'];
let drink = ['beer', 'boba', 'coffee', 'tea', 'liquor', 'soda', 'water'];
let rand;
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
textSize(40);
image(img, 500, 200);
rand = (Math.floor(random() * 3));
}
function preload() {
img = loadImage('./unnamed.png');
}
function draw() {
fill(random(colorlist));
let randomThought;
let test = 'thinking!'
if (frameCount % 20 == 0) {
// let size = random(50, 50)
if (rand === 0)
randomThought = random(fun)
else if (rand === 1) {
randomThought = random(food);
}
else {
randomThought = random(drink);
}
// randomThought = random(thoughts);
text(randomThought, mouseX, mouseY);
}
}