红宝石纸牌游戏

发布于 2024-07-27 14:03:02 字数 110 浏览 6 评论 0原文

我想用 ruby​​ 构建一个简单的独立纸牌游戏。 有什么我应该使用的库吗? 我是否需要游戏库才能将纸牌从一堆移动到另一堆? 我从未写过任何游戏,也很长时间没有构建独立应用程序,这就是我迷失的原因:)

I would like to build a simple standalone solitaire game in ruby. Are there any libraries I should use? Do I even need game libraries to have cards moved from one stack to another? I have never written any games, and I haven't built a standalone app for a long time, that's why I'm lost :)

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

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

发布评论

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

评论(6

尤怨 2024-08-03 14:03:02

看来你正急于进入游戏的图形部分。 你有没有深入思考过你的游戏逻辑? 我也从事游戏开发,在进入图形之前我通常做的就是实现所有游戏逻辑(或其中的大部分),以便我可以在系统控制台/命令行中进行测试。 当我对它感到满意后,我会转向图形、声音、动画和其他很酷的东西

It seems you are rushing into the graphics part of your game. Have you thought, deeply, about your game logic? I'm also into game development and what I usually do before going into graphics is getting all the game logic implemented (or the most part of it) so I can test in the system console / command line. After I'm happy with it, I move on to graphics, sound, animation and other cool stuff

晨敛清荷 2024-08-03 14:03:02

我倾向于同意 Nairdaen 的观点,即首先研究领域逻辑。 但是,如果/当您想使用图形/声音时,我建议 Gosu 因为它有一个非常好的和简单的API。

I tend to agree with nairdaen about working on the domain logic first. But, if/when you want to work with graphics/sounds, I suggest Gosu as it has a very nice and simple API.

噩梦成真你也成魔 2024-08-03 14:03:02

我曾经使用 Rubygame 来制作碰撞原型并将其可视化。 这是一个很好的 2d 游戏图形库。

对于问题的“独立”部分,在 Ruby 中有点棘手,因为运行 Ruby 应用程序需要 Ruby 解释器和应用程序使用的所有库。 分发游戏对于用户来说可能会变得很麻烦。 但是,您可以使用 RubyScript2Exe 拥有独立的 Windows 应用程序(读取:.exe)。

I used Rubygame once to prototype collisions and visualize them. It's a good graphic library for 2d games.

For the "standalone" part of your question, it's a little bit tricky in Ruby because running a Ruby application requires the Ruby interpreter and all the libraries used by your application. Distributing your game can become cumbersome for the user. However, you can have a standalone Windows application (read: .exe) using RubyScript2Exe.

喜你已久 2024-08-03 14:03:02

我听说 Shoes 很容易用于 GUI 开发,但我没有任何个人经验。 您可以使用它来绘制游戏屏幕并在单击卡牌后移动卡牌。 除此之外,我认为除非您有特定的问题,否则您不需要任何库。

I hear Shoes is easy to use for GUI development, but I don't have any personal experience with it. You could use it to draw up the game screen and move the cards around once they're clicked. Asides from that, I wouldn't think there's any libraries you would need unless you have a particular problem in mind.

Hello爱情风 2024-08-03 14:03:02

正如其他人建议的那样,从游戏引擎开始,它可以完全由控制台控制,然后再担心 GUI。

我是否需要游戏库才能拥有
卡片从一叠移到另一叠?

不,您可以将其实现为动态 Web 应用程序,并使用原型 javascript 库将卡片(作为图像)从一个“堆”移动到另一个“堆”。

As others are suggesting, start with game engine, which can be controlled entirely by console, and worry about GUI later.

Do I even need game libraries to have
cards moved from one stack to another?

No, you can implement it as dynamic web application and use prototype javascript library for moving cards (as images) from one "heap" to another.

手心的海 2024-08-03 14:03:02

是的,在考虑图形之前,您确实需要对所有逻辑进行编程。 许多进入编程领域的人认为图形表示是代码的主要表示,而不是逻辑后端。 逻辑是一切发生的地方,图形只是逻辑的表示。

Yeah you really need to program all the logic before even thinking about graphics. A lot of people getting into programming think about the graphical representation as the main representation of the code as opposed to the logic backend. The logic is where everything happens the graphics are just representations of the logic.

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