Showing posts with label box2d. Show all posts
Showing posts with label box2d. Show all posts

Friday, 11 January 2013

Tank Rampage's Tank 1 - Barrel


Tank Rampage’s tank is our pièce de resistance. It’s build up from 25 separate sprites and 27 joints. Its movements are fully simulated, including the tracks and antenna. 

Collision filtering with Box2d



Having a lot of bodies in the level at the same time can significantly impact framerates. Especially collision processing is a big burden to process. Add to that the fact that it’s usually necessary for gameplay to not have all bodies collide (for instance, bricks flying from a building should not collide with the player but should collide with the terrain): a way to filter these collisions is a necessity. Luckily, Box2D has a way to do this.


Box2D introduction


The physics engine used by Tank Rampage is called Box2D. Just like Cocos2d, it’s