December 2011
Beginner
693 pages
19h 56m
English
Once you have moving objects in your world, you want them to interact. One such mode of interaction is simple collision detection. Two objects are said to be colliding when they overlap in some way. You already did a little collision detection in Mr. Nom when you checked whether Mr. Nom bit himself or ate an ink stain.
Collision detection is accompanied by collision response: once you determine that two objects have collided, you need to respond to that collision by adjusting the position and/or movement of your objects in a sensible manner. For example, when Super Mario jumps on a Goomba, the Goomba goes to Goomba heaven and Mario performs another little jump. A more elaborate example is the ...
Read now
Unlock full access