Help me out with a physics shape

I’m trying to make a physics object in the shape of a star. For some reason it doesn’t display correctly. I’ve checked the points a few times and they seem to be correct. If I remove the inner points it makes a pentagon.

[lua]local star = display.newImage(“star_1.png”)
star.x = 160
star.y = 60
– 0, -22, 8, -8, 22, -6, 12, 6, 15, 21, 0, 13, -14, 22, -11, 6, -22, -6, -7, -8
physics.addBody( star, {density=3.0,
friction=0.8,
bounce=0.3,
shape={0, -22,
8, -8,
22, -6,
12, 6,
15, 22,
0, 13,
-14, 22,
-11, 6,
-22, -6,
-7, -8} } )[/lua] [import]uid: 98652 topic_id: 19748 reply_id: 319748[/import]

I think I’ve found a solution. The API states:

The maximum number of points (and therefore edges) allowed per collision shape is eight. Once defined, a shape definition can be re-used multiple times.
Note that these polygon coordinates must be defined in clockwise order, and the resulting shape must be convex-only.

Seems like I have too many points and may shapes are not convex. This limits what can be made with the physics module. Is it possible to create more complex shapes? [import]uid: 98652 topic_id: 19748 reply_id: 76461[/import]

try this
http://www.physicseditor.de/ [import]uid: 7911 topic_id: 19748 reply_id: 76465[/import]

Thanks this looks neat. I gave it a try and it crashed the first time I tried to import an image. Plus it costs money. I think I can figure this out with pencil and paper. [import]uid: 98652 topic_id: 19748 reply_id: 76468[/import]

Physics editor or adobe fireworks (with physics shape plugin) are the easiest way to go.

Check the physics api page again, if you need more than 8 points you can add multiple shape definitions to a body

[import]uid: 84637 topic_id: 19748 reply_id: 76486[/import]

Thanks for the reply. I had not heard of the Fireworks plugin. Too bad I don’t have Fireworks. I have Flash, Dreamweaver, Photoshop and Illustrator. For some reason I don’t have Fireworks. I guess I didn’t install it, I didn’t know I would need it until now.

I figured out the complex shapes and made a few. This was pretty easy. [import]uid: 98652 topic_id: 19748 reply_id: 76497[/import]

for physics shapes i use plugin for Adobe Frameworks [import]uid: 16142 topic_id: 19748 reply_id: 76508[/import]