|
Short answer: Like the story of Goldilocks and the Three Bears, I
found RUDL and
Ruby/SDL and tried each
one out. RUDL was too messy, and Ruby/SDL was too low-level... but there was no
third option which was "just right." I had to make it myself.
Long answer: I had been using pygame for about a year before I
discovered ruby. I wanted to make games in ruby, but I also loved how easy
pygame was to use, so I looked around for an SDL binding for ruby.
I found RUDL, and thought my search was over: here was somebody who, like
me, wanted a pygame-like library for ruby. But the API was a jumble, the
documentation was sparse, and when I started trying to edit the C code to add
some missing Rect methods, I was repelled by the mess. I spent a few days
toying with the idea of renovating the code and API, with the intent of sending
a patch to RUDL's author. Eventually however, I came to the conclusion that
like a rickety old building, it would be less expensive to tear down and
rebuild than it would be to repair piece-by-piece.
I also found Ruby/SDL, but it was just a simple wrapper around the SDL C
functions; I wanted something higher-level. I experimented with adding a layer
of ruby code on top of Ruby/SDL to change it into something more like pygame;
the idea was to add a class here, alias a method there, and, "Voila!"
I would have my library, without having to touch any C code at all. I knew it
would be run more slowly, but that was unimportant. It turned out, however,
that with all the rebinding and rearranging of methods and classes I was doing,
it would be far simpler to modify Ruby/SDL in the C code than to do it all in
ruby.
So, I began to modify Ruby/SDL. However, as I have said, it was just a
simple wrapper around SDL: its functions were barely more than taking the
return value of an SDL function and converting it into a Ruby type.
"As long as I was working in C," I thought, "I could touch up
these functions to be a bit closer to my desired end result..."
Well, after about a year of working on and off in that line of thought, I
had rewritten almost all of Ruby/SDL's code and added a layer of pure-ruby
classes on top of that, and Rubygame existed as it is today. The result, as I
see it, is a library which is higher-level than Ruby/SDL, but without all the
mess of RUDL. Above all else, Rubygame is supposed to be clean, easy to use,
even fun -- that's why Rubygame is more than just another Ruby-to-SDL binding.
|