开发者

Iphone game cocos2d and box2d

I have image named "platf开发者_C百科orm.png" that represents one brick for platform of a IPhone game. I have a cartoon character that will jump on this platform.

A series of platform.png will form one complete platform. These series will be generated by swiping finger across Iphone screen. When character will jump on this platform it should go down like elastic and bounce back up. Can anyone tell me how to do this ?

Thanks in advance.


What yo want is Collision Detection. I don't think using Cocos2d will be a great idea to use in this case because you want to show elastic and bounce effects which should seem real. For this, what I suggest, is using Box2d which clearly help in showing the effects in a natural way. Here Collision Detection can be handled in a separate class known as ContactListener. You can study Box2d and ContactListener here. In ContactListener you can generate these effects and this class is very easy to handle. Two or three months back I used the same to create my game Pogo Jump and believe me I was very easy to work on Box2d.
Good luck..!!


heye , you have two options for this , either use box-2d/chipmunk or dont. If you have prior experience with Physics then i would say box-2d/chipmunk would look more realistic.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜