Box2D 是适合我的 iPhone 游戏场景的最佳解决方案吗?

发布于 2024-10-04 02:51:28 字数 354 浏览 2 评论 0原文

我计划在 Cocos2D 中构建一个基本的 iOS 反弹游戏。 Box2D 最适合以下场景吗?

该布局将由屏幕顶部的目标组成,屏幕中间有障碍物,阻挡从底部直接看到目标。用户将从屏幕底部发射球,将球从侧面和障碍物周围反弹,渴望击中目标。类似于突破风格的游戏。

随着游戏关卡的进行,障碍物会动态移动,从左到右、从左到右、从上到下等。

据我所知,碰撞检测可以单独使用Cocos2D来实现。不使用物理引擎也能实现球离开障碍物和墙壁的反弹和轨迹吗?

我在游戏场景中不需要重力。降低球的速度/速度至关重要。

请注意,我是 iOS 开发新手,有前端 Web 开发背景。

非常感谢建议和帮助。

谢谢

I'm planning to build a basic rebound iOS game in Cocos2D. Will Box2D be best suited for the following scenario?

The layout will consist of a target at the top of the screen, with obsticles in the middle of the screen, blocking direct view of the target from the bottom. The user will shoot a ball from the bottom of the screen by rebounding it of the sides and around the obsticles, aspiring to hit the target. Similar to a breakout style of game.

As the game levels progress, the obsticles will be moving dynamically, left to right and back, up and down etc..

I understand that the collision detection can be achieved using Cocos2D alone. Can the rebounding and trajectory of the ball off obsticles and walls also be achieved without using a physics engine?

I will have no need for gravity in the game scenario. A reduction in the velocity/speed of the ball will be essential.

Please note, I am new to iOS dev, coming from a background in front-end web dev.

Advise and help much appreciated.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨夜星沙 2024-10-11 02:51:28

您当然可以在不使用现有物理引擎的情况下完成这一切。然而,一旦开始与移动物体和不同形状的物体发生碰撞,使用开箱即用的解决方案就开始变得有利。

在没有重力的情况下设置 box2d 很容易,它会给你所有的碰撞计算和速度的东西

You certainly can do all that without using an existing physics engine. Once you start doing collisions with moving objects and objects of different shapes, though, it starts to become advantageous to use an out of the box solution.

It's easy to setup box2d without gravity and it will give you all of the collision calculations and velocity stuff

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文