简单的 iPhone 加速计球迷宫游戏

发布于 2024-09-27 21:17:31 字数 125 浏览 2 评论 0原文

我想制作一个简单的 2D 游戏,用户必须在迷宫中导航球(当然使用加速度计)。我使用了一个简单的视图来利用加速计并在屏幕上移动球。现在我该如何建造迷宫呢?我必须使用 cocos2d 或类似的东西吗?当球撞到迷宫的墙壁时如何让球停止或反弹?

I want to make a simple 2D game where the user has to navigate a ball through a maze (using the accelerometer of course). I used a simple view to make use of the accelerometer and move a ball on the screen. Now how do I go about building the maze? Would I have to use cocos2d or something similar? How do I make the ball stop or rebound when it hits the wall of the maze?

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

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

发布评论

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

评论(2

你穿错了嫁妆 2024-10-04 21:17:31

看看这个游戏...它在加速计和设定边界方面做得很好。

http://github.com/haqu/tweejump

Check out this game... it does a great job with the accelerometer and also setting boundaries.

http://github.com/haqu/tweejump

暖风昔人 2024-10-04 21:17:31

这是适用于 Android 而不是 iPhone 的,但它有一些与您的项目非常相关的部分,例如移动球。不包括球反弹或建造随机迷宫;它从文件加载迷宫。

对于球/墙弹跳,尝试这个问题

有关生成迷宫的信息,请参阅此问题

This one is for Android rather than iPhone, but it has some parts that are very relevant to your project, such as moving a ball. Does not include ball rebounding or building a random maze; it loads mazes from a file.

For ball/wall bouncing, try this question.

For generating a maze, see this question.

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