Hi! I’ve recently started working on my firs game for mobile devices using this awesome engine and I’ve encounered some difficulties with creating a physical objects in my game. The thing is that when I use the following code I use cpVert array of 4 points and then the cpShape would be a rectangle.
So as it’s just a rectangle it behaves as a rectangle but the image in the space is a cloud. Basically this cloud has a non-rectangle shape and I’d like it to behave as ab object of an irregular shape. Is there any methods to calculate cpVect verts[] = array from textures or what else can I do for my purpose?
Thanks in advance!
I’d really appreciate your help!
Cocos2d and box2d don’t have auto create physic shape with the texture.
You can create this polygons shape with many little shapes, or used physics editor cocos2d and that create many shape without you.
I use http://www.codeandweb.com/physicseditor
I guess this physics editor generates some plist file? I would really like to see some example of using this file. I’ve seen using this file for animation but their solution is not applicable for us. Could you please show how to use this editor in code or point me on a right link with example? Thanks!
okay, thanks. I think we’re gonna have to write up some image self tracer on Qt that would just generate the cpVect [] array to copy-and-paste… So manually hit the edjes of a picture and save their position.