Mini Project 2: Interactive Drawing

Interactive Drawing
Interactive Drawing after Space Bar is Clicked
Code for Typical Functions
Code for Interactive Functions

For mini project 2, I created an interactive drawing that incorporates various functions and colors. The drawing pad itself defaults a lavender shade, and the drawing is initiated by clicking the mouse, where the colors alternate from white, peach, and lagoon blue depending on the x position of the mouse. To clear the background, the space bar can be clicked, which also triggers the background color to switch from lavender into a light pink shade. I also included codes that allow for a larger variety of drawing colors, which are triggered by the key function: q, w, e, and r. The difference between the normal key function and keyCode is that the key function represents letters on the keyboard, while keyCode represents keys like backspace and arrows. When these keys are clicked alone, they variate in stroke weights and take on the color of the primary colors (white, peach, lagoon blue). However, if both the keys and mouse are pressed simultaneously, then the both the stroke weight and color will change into its respective codes. These colors include black, hot pink, periwinkle, and electric purple, with each key possessing a larger stroke weight. All the stroke weights, primary colors, and secondary colors can be alternated to generate all the colors with all stroke weights. I learned how to utilize the key function to change features within my canvas, and how to incorporate variations of stroke weight and the mouse function. The most difficult part of this project was alternating the stroke weights. I did trial and error with various features like making the stroke weight increase with the coordinates, but experienced much difficulty in doing so. My experience is limited since I joined the Creative Coding class two weeks after the semester began, which has caused me to fall behind. There were moments where my code wouldn’t run properly because I forgot to place a bracket or I layered it in the wrong place. Overall, there was much more I wanted to experiment with in this interactive drawing, but encountered extreme difficulty which led me to create something within my area of knowledge and experience. 

Leave a Reply

Your email address will not be published. Required fields are marked *