Bouncing Balls Project

BouncingBalls

Going deeper into processing.js we learnt the fundamentaals of integrating Physics into the program, and make objects move accordingly. By incrementing the speed of the variable that controls the object’s speed, we were able to make it move across the windows in whichever direction we liked.

The next challenge was to reverse it’s direction on hitting the edge of the window. In order to accomplish his task, we used if statements in the draw loop which changed the changed the speed of the object from positive to negative, hence resulting in it moving in the opposite direction.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s