开发者

Finding Contact point - Box2d with Cocos2d

开发者 https://www.devze.com 2023-04-10 19:59 出处:网络
I\'m building a game with Cocos2d + Box2d I want my hero\'s jump direction to be orthogonal to the ground he is standing on.

I'm building a game with Cocos2d + Box2d

I want my hero's jump direction to be orthogonal to the ground he is standing on.

My idea is that I use a vector from开发者_JS百科 the contact point (hero with ground) to the Center of the Hero Sprite. Then I use an impulse to make the hero jump.

Has anyone an idea how I could do this? How can I find out the contact point?

0

精彩评论

暂无评论...
验证码 换一张
取 消