dynamic physics shape with sprites

Hi,

I have a sprite with 8 images that I need to play in enterFrame event handler. This sprite is also added as a physics body for collision detection.

I found from other discussion that I need to remove/add the body with different shape data to get proper collision detection.

Will it hurt the performance if I am removing/adding this physics body in every frame (in 60 fps)? Or is there a better way to solve this issue? [import]uid: 12109 topic_id: 23917 reply_id: 323917[/import]

you should use the PhysicsEditor which is a third party tools?Its very handy? [import]uid: 125086 topic_id: 23917 reply_id: 96834[/import]

Not totally sure on what you need, but also remember that you can add multiple physics bodies to an element.

http://developer.anscamobile.com/content/game-edition-physics-bodies
[import]uid: 21331 topic_id: 23917 reply_id: 96856[/import]

I guess I just have to play with the code to test for performance. [import]uid: 12109 topic_id: 23917 reply_id: 96868[/import]

Hi tsawan.

Not sure if this is what you need, but I recently made a skateboarder who was a 30x30 sprite.

I made him a physics object composed of 2 physics bodies in a table.

One body for the skateboarder himself, (30x25) and another for the board, (30x5).

Each body had it’s own obj.myName tag to filter collisions. That way, when the “board” hits the terrain nothing happens, but when the “player” object hits the ground it’s game over.

Despite the collision bounds for the “player” body being a rectangle, it’s not noticable at all in the game once you factor in the camera, motion in different directions, rotation etc.

Is that the kind of thing you’re trying to accomplish? If you’re a little more specific we might be able to give a better response.

Cheers

Dan [import]uid: 67933 topic_id: 23917 reply_id: 96889[/import]