top of page

Bouncing Gray Ball

Part 1: Make a circle bounce back and forth around the canvas.

Part 2 Challenge: Make its fill color bounce back and forth fading from white to black and then back to white again at the same time.

Part 3 Challenge: Make the fill color bouncing back and forth sync up with the ball bouncing back and forth.

For some reason my object literal ball.size was not computing...

UPDATE: Well I realized that I was calling ball.speed as ball.speed, when it should have been ball.sp....

But I got it to work! I dived right into the synced gray fill with bounce, and this was pretty easy (except for the aforementioned dumb error) since I had done the bouncing candy before this.

See the sketch here

6 views0 comments

Recent Posts

See All
bottom of page