我应该怎么做这个(游戏)?
现在我已经编写了大约 80% 的游戏代码,剩下的 20% 是游戏的实际部分。我需要知道我应该如何继续实际制作游戏部分。 它几乎与 Doodle Jump 有点相似。将会有重力、加速度计和平台的生成系统。我需要知道是否应该使用 UIKit 或 Cocos2D 来实现此目的。
我知道我可以使用 UIKit 轻松实现重力和使用加速度计,但我担心平台部分。我的“Doodle Jump 角色”不是常规的正方形或矩形,所以我应该尽可能地裁剪它吗?我担心的原因是因为假设角色落在平台上,所以他的身体可能会有点偏离,因为 CGRectIntersectsRect 没有像素碰撞检测,所以你认为这样可以吗?
如果您需要更多信息或不确定我要做什么,请告诉我。最后我只需要知道我应该使用 Cocos2D 还是 UIKit 。 请让我知道您的想法。
谢谢!
Right now I have coded about 80% of my game and the remaining 20% is the actual game part of it. I need to know how I should go upon actually making the game part.
Pretty much it will be somewhat similar to Doodle Jump. There will be gravity, the accelerometer, and a spawn system for platforms. I need to know if I should use UIKit or Cocos2D for this.
I know I can do gravity and use the accelerometer easily using UIKit but I am worried about the platform part. My 'Doodle Jump character' is not a regular square or rectangle so should I just crop it as best I can? The reason I am worried is because say the character falls on a platform, so his body could be a little off since CGRectIntersectsRect does not have pixel collision detection, so do you think it is fine the way it is?
If you need more info or aren't sure what I am trying to do, just let me know. In the end I just need to know if I should use Cocos2D or UIKit.
Please let me know your thoughts.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的答案是,虽然你可能能够在 UIKit 中开发游戏,但我怀疑从长远来看,在 Cocos2D 中开发游戏会更好。您不仅可以拥有更适合执行碰撞检测等操作的工具,还可以使用物理引擎来处理重力等。基本上,Cocos2d 就是为了做你想做的事情而设计的,而 UIKit 不是……它是为用户界面而设计的。
尽管如此,您所做的碰撞检测很可能不需要降低到单个像素的水平。一个矩形可能就足够了,或者您可以使用多个矩形来获得更高的准确性。那么你能在 UIKit 中实现它吗……也许吧,但我敢打赌,如果你使用 Cocos2d,你的游戏整体效果会更好。
My answer would be that, while you may be able to develop the game in UIKit, my suspiction is that it will be better in the long run to do it in Cocos2D. Not only will you have tools which are better for doing stuff like collision detection, you can also use a Physics Engine to handle the gravity and things like that. Basically, Cocos2d was made to do exactly the kinds of things you want to do, and UIKit wasn't...it was made for user interfaces.
Still, the collision detection you do will, mostly likely, not need to be down the level of individual pixels. One rectangle might be enough, or perhaps you can use several to get more accuracy. So can you pull it off in UIKit...maybe, but I bet your game will turnout better overall if you use Cocos2d.