xxxxxxxxxx
// images variables
var bg;
var road;
var adventureclub;
var fish;
var grassmushrooms;
var theEyetv;
var women;
// position variables the images
var xroad;
var yroad;
var xbg;
var ybg;
var xadventureclub;
var yadventureclub;
var xfish;
var yfish;
var xwomen;
var ywomen;
var xgrassmushrooms;
var ygrassmushrooms;
var xTheEyetv;
var yTheEyetv;
function preload() {
bg = loadImage('bg.png'); //Load background image
road = loadImage('roadd.png'); // Load road
adventureclub = loadImage('adventureclub.png'); // Load adventureclub
fish = loadImage('balık.png'); // Load the fish
women = loadImage('kadın.png'); // Load the women image
grassmushrooms = loadImage('u.png'); // Load grassmushrooms
theEyetv = loadImage('nk.png'); // Load the eye
}
function setup() {
createCanvas(600, 800);
xBg = 0; // Set x and y position of the bg
yBg = 0;
xroad = -130; // set x and y of the eyes images
yroad = -120;
xadventureclub = 550; // set x and y for the dada
yadventureclub = 50;
xfish = 80; // set x and y for the tree
yfish = 100;
xwomen = 40; // set x and y for the owl image
ywomen = 390;
xgrassmushrooms = 400; // set x and y for the bushes image
ygrassmushrooms = 320;
xtheEyetv = 570; // set x and y for the single eye image
ytheEyetv = 440;
}
function draw() {
image(bg, xBg, yBg); // Draw bg
image(road, 130+xroad, 100+yroad); // Draw road
image(adventureclub,xadventureclub-450, yadventureclub-30); // Draw adventureclub
image(fish, xfish,yfish-600); // Draw fish
image(women,30+xwomen,ywomen-330); // Draw women
image(grassmushrooms, xgrassmushrooms-400, ygrassmushrooms-300); // grassmushrooms
image(theEyetv, xtheEyetv-550, ytheEyetv-200);
}
function keyPressed() {
if(key == 'r' || key == 'R') {
// Set random position for the eyes
xroad = random(-400, -80);
yroad = random(-400, 500);
// Set random position for the Text
xadventureclub = random(500, 590);
yadventureclub = random(0, 150);
// Set random position for the eye
xfish = random(500, 590);
yfish = random(180, 300);
xwomen = random(0, width);
ywomen = random(300, 500);
xgrassmushrooms = random(-400, width);
}
if(key == 's' || key == 'S') {
saveCanvas('DenizSönmez-collage.jpg');
}
}