For this week Project we were required to make some changes to our image created from last week. Some of my changes involve creating variables in the place of 'hard coded' information. For example I found objects that are reusables inside of the image and created variables for them, like the dimensions of the pool balls, the shadow and the highlights. I was able to reference that same dimension variable for each ball. You can see all the variables I added between lines 13-24. I also inputed setup() and draw() which I did not have in the image last week.
For a new design element I added a little bit of detail to the highlights with a 1.5 weighted white stroke. I made sure not to add any strokes anywhere else where it would ruin the illusion. I also added two functions one for mouseDragged and one for keyPressed.
mouseDragged - as shown in the demonstration I made it possible to drag the white cue ball around the scene. I had to also move the shadow and the highlight with the cue ball, so I had to do a little bit of math to make sure the cure ball highlight and shadow stayed in their respective positions based on where the cue ball was dragged.
keyPressed - also shown in the video where the cursor is outside of of the window I am using my keyboard to move the cue ball. I had to use a conditional statement to check if a special key (arrow keys) are being used and if they are I then had to check which key is being used. For each arrow key we need to move along the X or Y axis with either adding or subtracting from the current positions
Issues - I had a few issues, I initially started with wanting to make the pool balls 3D, which looked cool for a moment however when I dragged the cue ball it looked like a snake and left a trail, I later realized it was because I was not using a solid background. The layering I did also proved to be an issue because I would have also like for the cue ball to stay within the bounds of the darker green surface but that was not something I understood how to do just yet. (would be cool to add later though, if possible)