xxxxxxxxxx
//upload all images
let group1 = [
"veg1.png",
"veg2.png",
"veg3.png",
"goth1.png",
"goth2.png",
"goth3.png",
"goth4.png",
"kub1.png",
"kub2.png",
"kub3.png",
"kub4.png",
"md1.png", // 11
"md2.png",
"md3.png",
"md4.png", // 14
"peo1.png",
"peo2.png",
"peo3.png",
"peo4.png",
"peo5 kopya.png"
];
//empty array for getting all images
let imgs = [];
// blank image id
let imgID = 0;
function preload() {
//we load all images with that command
for (let i = 0; i < group1.length; i++) {
imgs[i] = loadImage(group1[i]);
}
}
function setup() {
//the classic setup thing
createCanvas(1000, 1000);
background(100);
noLoop();
imageMode(CENTER);
angleMode(DEGREES);
}
function draw() {
background(255);
imageMode(CENTER);
//our image groups:
// Gothic
push();
translate(-100,0);
let gid = round(random(3,6));
//let xg = random(300,400);
let xg = width/2;
let yg = height / 2;
image(imgs[gid], xg, yg);
pop();
describe('A random part of the gothic architecture image')
// Modern
let mid = round(random(11,14));
let xm = random(600,700);
let ym = height / 2;
image(imgs[mid], xm, ym);
describe('A random part of the modern architecture image')
// dome
push();
scale(1.2);
let did = round(random(7,10));
let xd = random(400,600);
let yd = random(100,120);
image(imgs[did], xd, yd);
pop();
describe('A random dome image')
// veggies
//push();
let vid = round(random(0,2));
let xv = random(300,700);
let yv = random(600,800);
image(imgs[vid], xv, yv);
//pop();
describe('Random plants and trees images for composition')
// people
//push();
let pid = round(random(15,19));
let xp = random(600,700);
let yp = random(700,800);
image(imgs[pid], xp, yp);
//pop();
describe('Random people images for composition')
}
function keyPressed() {
//the replay function without press button all the time
if (key == 'r') {
draw();
}
}