Ruby

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

About Ruby

Ruby is an Object Oriented Scripting language developed in Japan by Yukihiro Matsumoto; it's more widely used in Japan too.

The Ruby syntax is somewhat derived from Perl and Smalltalk, and the semantics of the language are easy to understand and use. Some nice features of the language:

  • Everything is an Object
  • Easy to extend existing library classes
  • String and file manipulation is a pleasure

Ruby can also be extended through the use of C, and it can be embedded into C programs.

If you plan to use Ruby for game development you might also want to consider Python. Both languages have up- and downsides, so choose with care.

The only obvious downside to Ruby is its execution speed; classic of interpreted languages.

Ruby can be found at: http://www.ruby-lang.org

A lot of useful extensions can be downloaded from Ruby Application Archive: http://raa.ruby-lang.org

You can find there two different SDL ports, OpenGL bindings, a Ruby-game module, and some games (but there aren't any really interesting yet).

Tutorials

Ruby game programming

  • Rubygame - Pygame for Ruby
  • Ruby/SDL - SDL Binding for Ruby.
  • Rubyscript2Exe - Allows users to run your game without needing Ruby. Creates a single executable for your application (Windows, Linux, Mac). Tests indicate that this works fine with Ruby/SDL.
  • Gosu - Multi-platform game development library for Ruby and C++.