Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

DragonRuby Game Toolkit

An intuitive 2D game engine. Fast, cross-platform, tiny, hot loaded. · By DragonRuby

Best way to track game files using Git

A topic by pappyyy created 20 days ago Views: 163 Replies: 6
Viewing posts 1 to 5

Hi there!

I'm a long time Ruby developer, first time game maker, eager to see what I can build with DragonRuby!

I've downloaded the Mac zip and played around with bunch of the samples, especially the keyboard and sprite ones.

However one piece I'm trying to get my head round is how I should track my files using Git, within the context of DragonRuby. Should I be committing the dragonruby binary with each (private, of course) repository? Or, should the dragonruby binary sit one directory higher than my game files, similar to where the mygame directory sits in the starter zip.

As an experiment, I moved the dragonruby file into ~/git, and set up a main.rb file in ~/git/videogame/app. Upon running ./dragonruby videogame/ from the ~/git directory, I get a juicy "Startup failure! Couldn't create game context" error, so clearly I'm doing something wrong.

Basically, I'm interested to hear how everyone has dragonruby set up alongside their version tracking 🙂


You can point ./dragonruby at any folder. Try copying one of the samples into another folder that will become your git repo. For example, `cp -r samples/04_sounds ~/git` You can then check that file in to source control and run it via:  `./dragonruby ~/git/04_sounds`

Hm, I must be missing something, because that give me a "Couldn't create game context" error as well!

I was wandering about the same thing. Fortunately, timgaleckas's suggestion works for me (in the linux version at least), so my day is saved! My main concern was that I actually would like to post some code publicly so including DragonRuby binaries was totally out of the question.

Yes, perhaps the solution is to add the binary to `.gitignore` for any public repos?


This is my approach on both Linux and OS X:

1) Unzip dragonruby in $HOME/opt/dragonruby, so that the dragonruby executable is $HOME/opt/dragonruby/dragonruby

2) Inside .bashrc or .zshrc add somewhere `export PATH=$PATH:$HOME/opt/dragonruby`

3) To start a new game I create an empty folder which will contain the following structure:

- app/main.rb


This is the `` content:



dragonruby ./


By the way, many distros also have `~/bin/` in `$PATH` already, so you should also be able to just plop it in there.