Game Development Reference
In-Depth Information
2.
Test the movie and see what happens:
Did you see it? Now the bullet bounces on the barrier, and the contact is
solved as you are used to seeing it.
3.
Apply the bullet property to the projectile fired by the siege machine in
your Angry Birds prototype, and you'll have an accurate simulation running.
Now let's see the last special type of body you can create with Box2D.
Allow bodies to overlap while detecting
contacts with sensors
Sometimes in your games, you may need two bodies to overlap just like there wasn't
any collision, while detecting the collision. This can be achieved using a sensor : a
fixture that detects contacts without producing responses.
You can use sensors to create bodies so that you'll know when they collide without
any physical contact between them. Just think about a character controlled by the
player and a switch: you want to know when the player hits the switch to trigger
some event, but at the same time you don't want the switch to react to player collision.
 
Search WWH ::




Custom Search