为 iPhone 创建基于文本的 RPG 游戏

发布于 2024-12-18 03:51:41 字数 141 浏览 2 评论 0原文

我想为 iPhone 创建一款基于文本的 RPG 游戏。在此用户将提出一些带有答案的问题,并根据用户选择的答案导航到下一页。根据要求,我必须将整个故事存储在应用程序本身中。当用户选择时,我需要访问故事中的每个事件。那么我可以使用哪种数据库呢? 请分享您的想法。 谢谢。

I would like to create a text based RPG game for iPhone. In this user will have some questions with answers, and navigate to the next page depends on the answer in which the user selects. As per the requirement I have to store the entire story in the app itself. And I need to access each event in the story, when the user selects. So which kind of database can I use?
Please share your ideas.
Thanks.

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

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

发布评论

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

评论(1

红玫瑰 2024-12-25 03:51:41

我不太确定您是否需要创建某种类型的设备外数据库。如果游戏有预定义的答案和问题,那么您可能应该在设备上加载包含每个答案和问题的应用程序。

我确信有很多方法可以解决这个问题,最简单的是 if/else 语句。如果故事情节很长,这显然会成为一个障碍,并且很容易搞砸。

我想到的一件事是使用树表示来设计故事。起点是树的根部,从那里用户将沿着树向下前进,直到最终到达叶子(末端)。根据用户为每个页面提供的选项数量,如果您对这种类型的数据结构有所了解,那么实现起来并不难。

但是,这只是我的想法。不过,我肯定会考虑使用树数据结构。

I'm not so sure you need to create some type of off-device database. If the game has predefined answers and questions then you should probably load the app with each of these on the device.

I'm sure there are plenty of ways to go about this, the simplest being if/else statements. This would obviously be a hindrance and easy to mess up if the storyline is long.

One thing that comes to mind would be to design the story using a Tree representation. The starting point would be the root of the tree, and from there the user would progress down the tree until it eventually reaches a leaf (end). Depending on the number of options a user has for each page, this really wouldn't be too tough to implement if you have any knowledge of this type of data structure.

But, this is just off the top of my head. I would definitely consider the use of a Tree data structure though.

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