Chipmunk cocos js

how do i generate a physics body for this

by creating convex shapes or by using tools that supports cocos2dx such as physics editor from codeandweb.

1 Like

@jajabor I have mentioned a few times that cocos2d-js hasn’t been updated in many years and is deprecated. It may or may not do everything you want to do anymore. Be prepared to write your own implementations for functionality you may want. Please refer to the API docs:

I honestly dont know how many people here will be able to answer your questions.

Please think about switching to Cocos Creator.

my project is on cocos2d-js, so kinda stuck here

i want a physics body that act like a cup, thus concave shape,
i cant seem to draw it

It seems perhaps you should use box2d directly or chipmunk. If your needs are simple you could write a basic implementation yourself using simple
bounds checking and fire your own custom event when there is “contact”.

i will also have rotate the cup or the blender

Ok, so do that too? Nodes observe parent child relationships. Nodes can have all sorts of transformations done to them.

I’d suggest reading our programmers guide to understand the basics.