推荐 Gem 在 Ruby on Rails 中构建一个非常简单的浏览器游戏

发布于 2025-01-01 01:53:01 字数 226 浏览 3 评论 0原文

我正在使用 Ruby on Rails 构建一个非常简单的游戏。 两个玩家应该互相玩一个非常简单的游戏(你可以想象一个像井字游戏这样的简单游戏)。但预计会同时玩数千个井字游戏。 我想知道什么是最简单、最快的 Ruby Gem 可以满足我的需求。我读过有关 ruby​​game 或 gosu 的内容,但它们似乎比我需要的更复杂。 我很感激任何建议。请注意,我想将所有用户的动作和所有游戏的结果存储在我的数据库中。

谢谢!

I am building a very simple game with Ruby on Rails.
Two players are supposed to play a very simple game against each other (you can imagine a simple game like Tic-Tac-Toe). But it is expected that thousands of tic-tac-toe instances are being played at the same time.
I want to know what is the simplest and fastet Ruby Gem that satisfies my needs. I have read about rubygame or gosu but they seem to be more complicated than what I need.
I appreciate any advice. Note that I want to store all user moves and results of all games in my database.

Thanks!

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

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

发布评论

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

评论(1

赠我空喜 2025-01-08 01:53:01

我找到了一种方法来做到这一点。由于 Rails 不是为异步请求而设计的,因此我使用第二个 Node.js 服务器通过 Redis 与 Rails 进行通信。 Node.js 负责将消息推送到客户端和 Rails 服务器。 Rails 不是为此类应用程序设计的,但我可以让它工作。一旦我完成了测试,我将评论可扩展性。

I found out a way to do this. Since rails is not designed for asynchronous requests, I use a second Node.js server that talks to rails over Redis. Node.js takes care of pushing messages to clients and the rails server. Rails is not designed for such application but I could make it work. I will comment on scalability once I'm done testing it.

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