Ruby: Running Gosu game from a web browser

为君一笑 提交于 2019-12-24 11:54:18

问题


So what I want to do is this:

  • User visits www.website.com
  • There is a button called "play game"
  • Gosu game (which I have already written) will launch the window.
  • User can play game.

so maybe it'll look like this:

<button type = "submit" > PLAY GAME </button>
<iframe><%= MyGameFile.rb.execute %></iframe>
<!-- Iframe will contain the window of the Gosu app --> 

I've been reading around and I've seen that there may be a way to trick it into running by using Jruby. I've also thought that maybe it would be a good idea to use Opal to recompile the Ruby code into JS and maybe somehow run it that way.

But to avoid confusion, the question is: Is it possible to implement the steps above? Thanks for any answer.

来源:https://stackoverflow.com/questions/33870378/ruby-running-gosu-game-from-a-web-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!