0
votes

Can I get some advise, how realise the body damaging on pieces after colliding like Angry Birds. I can find just:

Create REAL explosions with Box2D – adding textures

Slicing, splitting and cutting objects with Box2D – part 4: using real graphics

but it's all for flash, me need for ios cocos2d box2d

1
What do you mean? the 2d physics or the sprite modification? - Simon Bergot
I mean the both of those moments: I've got two bodies (b2Body), how can I break this on the pieces when they collide. - Alexander Sharunov
In angry birds "intact" sprites are replaced by "damaged" versions first, and then they disappear. In the examples you gave 2d objects do not break when they collide. In the first example a box is sliced by multiple lines where you click (using random angles I would guess). In the second example you must slice them yourself. You never see them "break" on a collision. So try to make yourself clear. - Simon Bergot
ok. I try to make it more clear. In Angry Birds when you bird collide with glass or wood obstacle, the obstacle breaks into pieces, me need realize this effect. I've got b2Body (the Ball) which collide with obstacle, when the ball and obstacle collide, obstacle should breaks into pieces - Alexander Sharunov

1 Answers

2
votes

If I understand well you want to reproduce object breaking behavior from this video http://www.youtube.com/watch?v=9niqSk9VCi8

I am still not sure of what your are calling an object. I guess it is a single undeformable element (in the video there are 21 wood objects).

What is happening here is very simple: when an object is broken, it simply disappear. Then, a visual effect is produced: severel "broken pieces" sprites are randomly placed around the location where the object was broken. They spin and move slightly. Then they disappear themself.

No physic is involved, just a simple visual effect.