When programming a basic bouncing ball in Processing, at first it's best not to think of it as a "ball", but as a circle. The circle has a location (x,y), a radius, and a velocity (x,y). When the location and radius add up to a number greater than the size of your window, the velocity simply reverses. Here's a quick example.
@moonphoenix18 yep you right
shebotnov 4 days ago
thx for uploading! your video really helped a lot! I feel like I can understand this now.
just one question: shouldn't it be "xPos - 30 < 0" instead "of xPos + 39 < 0" ?
moonphoenix18 10 months ago
Thanks for the videos. That's a pretty cool trick ^_^
Wuzzly 1 year ago