For this assignment, getting the ellipse to bounce off all sides of the canvas was the simplest component. This required adjusting already existing code to accommodate for the addition of having the ellipse bounce off the top and bottom of the canvas as well as the left and right. To get the ellipse to change color after hitting each of the walls was a little more challenging. I just fumbled around with code until something worked.
https://editor.p5js.org/stephhernandez593/sketches/kpcj37De1
Comments