Code In The Dark Challenge.

Early this week, we got a challenge to identify and modify the code on the p5js birthday candles.



*we started first with by setting a variable for omg and mic that will be used latter to add an image to the canvas and set up micophone.

*the preload function was used to upload this image but there is also another way to do so, instead of a separate function line we will added to the create canvas line with the form.

  loadImage('assets/laDefense.jpg', img => {
    image(img, 0, 0);

we set up the microphone to receive input that will leather be used to change the image into a dark background giving the illusion as the candles being blown. also there is a console.log line (25) that execute the function when executed with a text “who turn off the lights” additional text is being added to the canvas with the tittle “don’t forget to make a wish when you blow the candles” An issue with event function is that you have to completely stop the draw loop and restart it and to clear the console you have to click the red play bottom on the top to start it over.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s