Game Development Reference
In-Depth Information
5.
Test the movie and make the bullet run by clicking on it:
As you can see, the bullet passes through the barrier, but the collision is
detected as shown from the following output text:
bullet->barrier
bullet->barrier
In this case, the message is reported twice as it's printed when scanning
collisions for the projectile and finding the barrier, and when scanning
collisions for the barrier and finding the projectile.
Summary
Using the two properties discussed in this chapter, you have learned how to manage
continuous collision detection in a discrete simulation, and how to create passive
bodies, which detect collisions without solving them.
Well, your journey into this topic ends here, but there's more to learn about Box2D.
You may be able to make Box2D games, but programming is a world that evolves
really fast, and you should always stay up to date. I suggest you often visit www.
box2d.org and http://box2d.org/manual.pdf , the official Box2D site and docs,
as well as my blog www.emanueleferonato.com for the latest tricks and tutorials.
Once you have made your first Flash Box2D game, don't forget to thank Erin Catto
for making such an awesome library and Boris the Brave for porting it to AS3.
 
Search WWH ::




Custom Search