5 Reasons To Build Your First Game In Ruby as a Beginner Game Developer

Michelle
3 min readSep 9, 2019

--

Whether or not Ruby is a good language to use in game development is a bit of a contentious topic. Opinions vary and quite a few aspiring game developers have asked the question. This Reddit thread for example has over 100 comments about the topic.

Ruby, however, is one of my favorite programming languages. Before I present my case, check out this quote by the designer and developer of Ruby.

“I hope to see Ruby help every programmer in the world to be productive, and to enjoy programming, and to be happy. That is the primary purpose of Ruby language.”

— Yukihiro Matsumoto

That’s wholesome AF.

1| It Ain’t Picky

Ruby isn’t like 5 year old you at the dinner table staring at a plate of broccoli.

It ain’t picky, which is a major benefit to anyone learning to code for the first time. As a beginner, you’ll be prone to errors and lots of them.

Ruby doesn’t care about semicolons, it doesn’t care if you invoke a method with or without parenthesis, and it reads closely to the English language.

Syntax matters in programming and Ruby’s straight forward syntax makes for quick learning and memorization.

Defining a variable in C++:

int health = 100;

Defining a variable in Ruby:

health = 100

You don’t have to specify that this variable’s data type is an integer. Ruby just knows!

2| Well Documented

Here is a link to the official documentation of Ruby.

Being official and all that, it’s a great place for explanations on anything Ruby related, but within those explanations, you’ll also find great examples.

3| Thriving Community

With the popularity of Ruby on Rails(a web-app framework), the Ruby community is huge and thriving.

What does that mean? It means there are people generously donating their time on improving the language and that may not mean a lot to a beginner, but the biggest take away from this is that it means Ruby is not a dead language.

You’ll be able to find solutions of any problems that come up by a simple Google search. It’s likely someone has ran into the same problem as you and they’ve already asked the question at places like Stack Overflow, Quora or Reddit.

It also means there are countless tutorials out there in both written and video format for different types of learners.

4| Ruby2D and Gosu

Ruby2D and Gosu are both free game development libraries for Ruby!

Both are well documented with numerous video tutorials to get your feet wet in game development with Ruby.

This means you don’t have to start completely from scratch, someone has already built some foundations for you!

5| Learning Other Languages Will Take Less Time

Once you fully understand the fundamentals of Ruby(variables, arrays, hashes, statements, etc), it becomes a lot easier to transition into another language.

Implementing ideas into your game will always involve a step-by-step process where you complete little tasks allowing you to arrive at the end goal. The logic to carry out these ideas will be the same no matter what language you learn and the only major difference will be syntax.

Take for example, a player’s inventory. If this inventory were stored in an array(a list), and I wanted to display it to my player, I may want to iterate over this list.

The syntax to iterate over an array for Ruby and C++ is most definitely different as shown in the examples below, but I’m essentially doing the same thing and that is going through each element of the array and displaying it to the player.

C++:

string inventory[] = {"Sword", "Shield", "Potion"};
for(const auto& item : inventory) {
std::cout << item << std::endl;
}

Ruby:

inventory = ["Sword", "Shield", "Potion"]
inventory.each do |item|
puts item
end

Resources for Beginners

  1. Handle Errors Without Losing Your Sanity
  2. Learn Ruby in One Video
  3. Try Ruby without Installing it

Links within this article:

  1. Reddit discussion on Ruby and Game Development
  2. Ruby official documentation
  3. Syntax Wikipedia
  4. Ruby2D
  5. Gosu

--

--

Michelle

Software Engineer who calls her mom every day, cares about diversity and inclusion, and eats frozen blueberries. She/Her.