xxxxxxxxxx
let r, g, b;
let value = 0;
// kuvien lataus
function preload() {
crow = loadImage('crow.jpg');
}
function setup() {
createCanvas(1000, 800);
// random värit
r = random(255);
g = random(255);
b = random(255);
}
function draw() {
background(220);
textFont('Georgia');
//kuukausi
let kk = month();
//alkuviesti
textSize(26);
fill(color('black'));
text("the oracle is present", 80,100);
//kristallipallo
noStroke();
fill(r, g, b, 127);
ellipse(200, 200, 100, 100);
//if(mouseIsPressed){
// kristallipallon värit, jos sitä painetaan
let d = dist(mouseX, mouseY, 200, 200);
if (d < 50) {
// Pick new random color values
r = random(255);
g = random(255);
b = random(255);
}
// kristallipalloa painetaan
function mouseClicked() {
if (value === 0) {
value = 255;
} else {
value = 0;
}
}
// toukokuu
if (month() === 5) {
textSize(40);
fill(color('white'));
text("Your lucky number is : " + kk, 50, 30);
image(crow,400, 200, 600, 600);
}
// kesäkuu
if (month() === 6) {
r=10;
textSize(40);
fill(color('white'));
text("Your lucky number is : " + kk, 50, 30);
image(crow,400, 200, 600, 600);
ellipse(50,50, r*frameCount/2, r*frameCount/2);
//syksy
if (month() > 6) {
textSize(16);
fill(color('red'));
text("Current Month is : " + kk, 50, 30);
image(crow, 100, 100, 1200, 900);
}
}
}