xxxxxxxxxx
69
let randW;
let modem;
let mushroom;
let mushroomW;
let mushroomH;
let mappedModem;
function preload(){
modem = loadSound('ModemSound.mp3');
mushroom = loadImage('furby.png');
}
function setup() {
createCanvas(600, 600);
background(200,40,40)
for(let i =0; i<100; i++){
image(mushroom, random(width),random(height),random(5,50),random(50,20));
mappedModem = map(mouseX, 0 width, 0.2, 3);
modem.rate(mappedModem);
}
// for (init; test; update) {
// statements
// }
}
function draw() {
for(let i=0; i<width; i=i+20){
line(i, 0, i, height);
}
for(let i=0; i<2*height; i=i+30){
let randW= random(width)
line(0,400,randW,i)
}
imageMode(CENTER)
image(mushroom, width/3 , height/3, mouseX , mouseY);
}
function mouseDragged(){
image(mushroom, mouseX, mouseY, 100, 100)
}
function mousePressed(){
if(modem.isPlaying()){
modem.pause();
}else{
modem.play();
}
}
function keyPressed(){
if(key == 'q'){
mushroomW=100
mushroomH=300}
}