xxxxxxxxxx
81
let leaf;
let tree;
let nest;
let thoughts=['feels like eternity',
'we escaped in a bug of time',
'a bug that allowed us to be',
'a perfect bug'
];
function preload(){
leaf=loadImage("leaf.png");
tree=loadImage("tree.jpg");
nest=loadImage("nest.jpg");
}
function setup() {
createCanvas(windowWidth, windowHeight);
frameRate(1);
push();
tint(255, 200);
image(tree,0,0);
pop();
fill('sienna');
textSize(40);
textFont('monospace');
let thought=random(thoughts);
text(thought,width/2,height/2);
}
function draw() {
//background(220);
imageMode(CORNER);
// image(tree,0,0);
let thought=random(thoughts);
textAlign(CENTER);
text(thought,mouseX,mouseY);
//angleMode(DEGREES);
push();
rotate(random(2)*HALF_PI);
tint(255, 80);
imageMode(CENTER);
image(tree, random(width),random(height));
}
function mouseClicked() {
clear();
// push();
// tint(255, 200);
imageMode(CORNER);
image(tree,0,0);
// pop();
// push();
// imageMode(CENTER);
// image(nest,width/2,height/2);
// pop();
let thought=random(thoughts);
text(thought,width/2,height/2);
//text('we escaped in a bug of time',width/4,height/2+36);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}