xxxxxxxxxx
55
let cookie;
let crunch;
let radius = 0 ;
let monster;
let size = 3.5;
let ferby;
function preload() {
cookie = loadImage('cookie.png');
crunch = loadSound('modem.mp3');
monster = loadImage('monster.png');
red = loadImage('red.png')
}
function setup() {
createCanvas(640, 360);
background(250, 0, 0);
}
function draw() {
imageMode(CENTER)
radius = radius+0.06
for (let i =0; i<15; i++){
image(cookie,random(width), random(height), radius, radius);
}
}
function mouseClicked(){
size = size + 3
if (keyIsPressed === true){
image(red, mouseX, mouseY, size+2, size+2)
}else
image(monster, mouseX, mouseY, size, size);
// crunch.play;
}
// function mouseClicked(){
// if (crunch.isPlaying){
// crunch.stop();
// }else{
// crunch.play();
// }
// }