xxxxxxxxxx
99
let x1=500;
let x2=1200;
let i;
let opacity=0;
let ay, ax;
let px=0;
let py=0;
let easing=0.9;
let offset =10;
let img1;
let img2;
let font;
let diam=20;
let direction=5;
let x=215;
function preload(){
img1= loadImage("images/eye1.png");
img2= loadImage("images/apple3.png");
font=loadFont("images/stolentimes.otf");
}
function setup() {
createCanvas(1280, 720);
for (let i = 200; i < 900; i++) {
image(img2,random( width), random(height), random(100));}
x = width / 2;
y = height/2;
strokeWeight(0);
centX=width/2;
centY=height/2;}
function draw() {
diameter= map(mouseX,30,width,10,300);
image(img2,width/2.25,height/2.5,diameter,diameter);
opacity +=.5* direction;
if((opacity<0)|| (opacity>255)){
direction= -direction;
}{
textSize(20);
fill (0,opacity);
text("Something feels...",width/100, height/1.2 +18);
text("shifty...",width/100, height/1.15 +18);
}
{
noStroke(0);
textSize(30);
}
fill(0);
{
if (keyIsPressed){
if(keyCode == RETURN);
text("",120,40,40,40);
text("YOU",120,80,40,40);
text("ARE ",500,200,60,60);
text("THE ",1100,130,60,60);
text("APPLE ",100,450,60,60);
text("OF ",500,560,60,60);
text("MY ",900,350,60,60);
text("EYE",1140,600,60,60);}
diam+= 10*direction;}
let targetX=mouseX;
x+=(targetX-x)*easing;
if(mouseIsPressed){
if(mouseButton == RIGHT){
image(img1,mouseX,mouseY);
x+=100;
offset=10;
}
}
else{ (mouseButton == true)
background(245,140,12,70);}
image(img1,mouseX,mouseY);
diam += 10 * direction;
}