xxxxxxxxxx
67
//This is my virtual project in P5, you most likely saw my paper miche owl I hope you like it and I hope that it brings you joy.
let hue = 100;
let saturation = 100
let brightness = 100;
//This is for color, this is what I use below to detwermine color
let picture;
let sound;
//this if for the backround
function preload() {
picture = loadImage('Owl.jpeg');
sound = loadSound('Funny Laugh.mp3')
//this is for the predownloaded image of the owl
}
function setup() {
getAudioContext().suspend();
createCanvas(600, 800);
//use picture as background, and this is how big it is
image(picture, 0, 0, 600, 800);
colorMode(HSB);
x = width / 2;
y = height / 2;
frameRate(10);
//frameRate(100)
//change this and radius below in order to make it cooler
//WARNING, prepare eyes
//how fast it goes
}
//defining variables
let radius = 10;
function draw() {
//this is for the sound over the mouth
if (mouseX > 160 && mouseX < 310 && !sound.isPlaying())
if (mouseY > 325 && mouseY < 425 && !sound.isPlaying())
sound.play();
textSize(10);
stroke(10);
fill(0)
text('hold the screen down and put mouse over mouth', 50, 750)
hue = random(0, 255);
saturation = random(0, 255)
brightness = random(0, 255);
textSize(30);
fill(hue, saturation, brightness);
text('THE OWL FULL OF JOY', 130, 35);
if (mouseIsPressed) {
userStartAudio();
stroke(hue, saturation, brightness);
noFill();
//I want no fill so that you can see the happy owl
rectMode(CENTER);
circle(mouseX, mouseY, radius);
square(mouseX, mouseY, radius);
//these are the shapes that appear when you press down
radius = radius + 5;
//radius = radius + 1;
//this makes it look cooler, make sure frame rate is 100 though
radius = radius % 500;
//this would be to repeat every 300
}
//put your mouse over the owl's mouth
}