P5 HW 2
- Shijo Thomas
- Apr 14, 2020
- 1 min read
Figuring out how to shift the y coordinate of the ball was very simple, but I had to go through a few iterations of the code. The first version of the code, I got the ball moving on it's y-axis along with x-axis by simply having the bit of code that was used to shift the x coordinates. The only problem with was it only bounced diagonally so I added another variable for the y coordinate speed, with x and y having different speeds it bounced around the canvas really well. The nest thing I did was add in the color changing aspect, what did in class made the color change continally, but with a small modification I made it change after every bounce it did.
コメント