xxxxxxxxxx
99
let myFont;
let myFont2;
var img;
function preload() {
song1 = loadSound('machines.mp3');
myFont = loadFont('AlteHaasGroteskRegular.ttf');
myFont2 = loadFont('AlteHaasGroteskBold.ttf');
lijnkrullanger = loadImage ('lijnkrullanger.png');
hoeklijnen = loadImage ('hoeklijnenregelm2klein.png');
potlood = loadImage ('potlood.png');
machine = loadImage ('machine.png');
buisjes = loadImage ('buisjes.png');
biep = loadImage ('bieppp.png')
}
function setup() {
createCanvas(windowWidth, windowHeight);
//background(240,200,54);
//background (255, 204, 0);nu is het: fdc438
background (253, 196, 56);
image(lijnkrullanger, windowWidth/12, windowWidth/13, windowWidth/4.2,windowWidth/31.5);
image(hoeklijnen, windowWidth/4000,windowHeight/900,windowWidth/20, windowWidth/20);
image(buisjes,windowWidth/1.22,windowWidth/9.3, windowWidth/6.6,windowWidth/6);
image(machine,windowWidth/1.37,windowWidth/6.9, windowWidth/8.8,windowWidth/7.7);
image(biep, windowWidth/5.8+windowWidth/7, windowWidth/22, windowWidth/20,windowWidth/40);
//fill(204, 101, 192, 127);
//rect(windowWidth/12, windowHeight/12, windowWidth/1.2, windowHeight/2);
let s = 'MACHINES';
fill(255,255,255);
textSize(windowWidth/25.5);
textFont(myFont2);
//textAlign(CENTER)
text(s, windowWidth/12, windowWidth/30, windowWidth/1.2, windowHeight);
let s2 = 'Er zijn machines en slangetjes, die de baby controleren en beter maken. Sommige slangetjes geven de baby eten, andere geven iets aan de baby om te genezen. De gekleurde draadjes dienen om te kijken hoe snel het hartje van de baby klopt.\n\n\nDoor te slapen wordt de baby sterker. Daarom moet je stil zijn als je op bezoek gaat. Zullen we dat eens proberen? Speel het spelletje!';
fill(255,255,255);
textSize(windowWidth/40);
textFont(myFont);
//textAlign(CENTER)
text(s2, windowWidth/12, windowWidth/8, windowWidth/1.65, windowHeight);
var button;
var col = color(25, 23, 200, 50);
button = createImg('knopplay.png');
button.size(windowWidth/6.6,windowWidth/12.1);
button.position(windowWidth/1.32,windowWidth/3.1);
button.mousePressed(changeBG);
button = createImg('knopterug.png');
button.size(windowWidth/7.9,windowWidth/15);
button.position(windowWidth/12,windowHeight/1.2);
button.mousePressed(changeBH);
button = createImg('knopluidspreker.png');
button.size(windowWidth/7.9,windowWidth/15);
button.position(windowWidth/4,windowHeight/1.2);
button.mousePressed(changeBI);
}
function changeBG() {
window.open("https://editor.p5js.org/Rose_Thys/present/YR7hm7PGT");
window.open("https://editor.p5js.org/Rose_Thys/present/aRgj3LAYC", "_self").close();
}
function changeBH() {
window.open("https://editor.p5js.org/Rose_Thys/present/aRgj3LAYC", "_self").close();
}
function changeBI() {
if (song1.isPlaying()) {
song1.stop();
} else {
song1.play();
}
}