

Remember this program from the animation tutorial, which displays a ball bouncing around the screen:

We’ll start with something simple and work our way up from there. If you can determine that two shapes touch, you can trigger some action- think of detecting when the user has moused over a button, or when a game character touches the floor or a badguy, or when your animation reaches a certain state.Ĭollision detection can be accomplished using code that ranges from simple if statements to complicated algorithms handling thousands of objects at once, and even libraries that simulate realistic physics. This tutorial introduces collision detection, which allows you to determine when two shapes touch.

Collision Detection Collision Detection tutorial processing advanced collision-detection
