LOLLIPOPS FROM THE CANDY SHOP
The second mini project that is about interactive drawing is very interesting and fun to explore. This project focuses on using variables, if-statements, mouse and keyboard interactions. In this mini project, what first came into my mind was about what will children be attracted to. Candies and lollipops came into my mind. So I wanted to make a story line on which, first the candy shop was shown in the first frame. To get some lollipop, users need to cover the house using the mouse which created a rainbow colored mouse. After that, you can see the lollipop and color the lollipop by moving the mouse. From there you get the lollipop and more lollipops.
In the first frame, I applied mini project 1 assignment into this assignment by drawing the candy shop with codes. The next frame I applied the movement of our mouse where it will draw a circle similar to sprinkles which are colored rainbow. Next, the lollipop will appear and when you drag the mouse inwards the lollipop will give color to it. After the lollipop appears and you have colored it, meaning you have the lollipop already. Another colorful circles will appear and it changes color in the last frame. On the last frame, you can draw more circles with color pink, green orange. This happened with the if (keyIsPressed) conditionals.
In this project, the variables are used to make coding easier . You can add, subtract, multiply, divide, and perform other mathematical or logical operations using variables. For instance, consider the rainbow mouse, which gracefully glides with “circle(mouseX – 10, mouseY – 10, 7),” all made possible through variable manipulation.
The conditionals I use in this programme is if(counter< x) which means if the frame changes the object inside the stated frame rate will appear. Also with the if (d < 105 && d > 90).
Which color the lollipop according to the if statements. Other than that I also use the true false stat
ements or boolean variables with “start1,” “start2,” “start3,” and “start4”. The reason for this is that the programme will only run the background once and not cover the previous sketch.
Keycode refers to the keys for example up shift left and represents the numeric value While key represent represents the alphabetic letters for a -z
<iframe src=”https://editor.p5js.org/Sharren-tanuwijaya/full/hnYsKdCoD”></iframe>