0

After some sample projects, I have started with my first game in cocos 2d and box 2d where objects fall from a parachute and you kill them using slingshot. Now i'm stuck @ couple of things for a while:

Collision Issue:

  1. Using Box 2d i have made collision with objects. However when i add a counter to get a count of my collision i doesn't work. Counter increases even though the percentile is moved out of the screen.Don't know how to get rid of this.

  2. I'm trying to get random rotation to my sprites which fall from above, Like a parachute experience. Now all of then rotate @ a same angle.

  3. Lastly i need to get rid of the surrounding sprites when collision happens. Ex: When the percentile collides with a falling object, in a radius of 2.5 cms the other sprites should also disappear.

I Badly need help and suggestions, hence all the 3 questions @ once :-). I have provided the link for my project so that you can look @ the source code. Desperately looking for your help guys!!!

Download Source Code:

http://jumbofiles.com/6fn5mmpnq1q8/Karthik.zip.html

Budding Developer,

Karthik

4

3 回答 3

0

问题 1 + 3:您需要阅读 Mikael 和 Marine 共享的链接

问题2:在cocos2d中,如果你想得到随机值,你可以使用支持函数(如:rand(),随机(),CCRANDOM_0_1()......)......我认为,你需要设置旋转值目的。我不知道你的问题,你需要解释一下(链接是“文件未找到或删除/由于不活动或 DMCA 而被禁用”)

于 2012-11-08T10:41:55.570 回答
0

你在这里有一个很好的教程:http ://www.raywenderlich.com/475/how-to-create-a-simple-breakout-game-with-box2d-and-cocos2d-tutorial-part-12

我认为一个可以解决你的问题:)

于 2010-12-10T20:50:19.177 回答
0

您可以获得针对您在此处描述的特定要求的最佳教程.....链接如下 http://www.raywenderlich.com/606/how-to-use-box2d-for-just -collision-detection-with-cocos2d-iphone 本教程分为两部分,并简要介绍了代码。代码已描述,您可以从那里获得大量帮助。

于 2012-02-17T13:19:07.633 回答