-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
You can get a build from the releases page or if you want the latest changes, from the Actions page on this repo.
The next entries will explain the different ways to run your game with this utility, if you want to know the pros and cons of each take a lok at the following table:
Standalone | Ruby Code is Hided | |
---|---|---|
Command Line | ~¹ | ✘² |
Boot File | ✔ | ✘³ |
Embedding | ✔ | ✔ |
-
¹: while the program is fully standalone, the user has to open a terminal to run your game. This can be a deal-breaker
if your players expect the classic click'n'run functionality of games. In case you intend to launch your game this way, you'll need
to make custom launchers for each platform (an
.ink
or.bat
in Windows,.desktop
or.sh
on Linux, for example) -
² ³: a possible workaround is compiling your Ruby source code to bytecode with
mrbc
. It is to note that as of now there aren't any known methods to reverse-engineer the bytecode.
Call the binary with your game's entry point (generally main.rb
) as argument:
gosu-mruby main.rb
It can run both Ruby and bytecode files.
Note
Experimental, feel free to raise an issue if you have a suggestion.
If there's a file named boot.rb
in the same directory as the executable, it'll load that automatically, this way your users don't have to launch a terminal to run your game, just a click is needed and nothing more.
Normally, your boot.rb
file will have something like this:
$: << 'src' # Add the src directory to the load path
require 'main'
# If you start your game loop in main or whatever other file, this isn't needed, however
# it can be done too here too
# MyGameWindow.new.show
Also can be called Fused mode, this way is more complex than the other two, but admittedly the one with the more pros. Take a look at its wiki page.
Once you have setup your project to be executed, you can package it as it is! There's no special thing to, just ZIP your
game along with the shared libraries (.dll
s, .so
s) and distribute it, make sure to rename the generic name of the executable
to one of your liking too.
You could try to use one of the platform-specific ways of packaging:
- Windows
- Linux
-
.deb
,.rpm
: I don't really know the specifics of how to make one of this. - AppImage: official packaging manual.
- Flatpak: official getting started manual.
-
Warning
Not tested. If you manage to package your game, I'd appreciate it a lot if you can contribute a guide!
The icon of the executable can be changed using Resource Hacker. The steps are the following:
- Open the executable, and you'll be greeted by this screen:
- Right-click the "Icon" entry and select Replace Icon ...:
- Then in the following screen, click Open file with new icon..:
- Once you select your icon, click Replace and save it: