______  ___      _____
  ___   |/  /_____ __  /_______________
  __  /|_/ / _  _ \_  __/__  ___/_  __ \
  _  /  / /  /  __// /_  _  /    / /_/ /
  /_/  /_/   \___/ \__/  /_/     \____/

Metro is a framework built around gosu (the 2D game development library in Ruby). The goal of Metro is to enforce common conceptual structures and conventions making it easier to quickly generate a game.

Code Climate

Build Status

Dependency Status

Why Use Metro?

You want to develop games in Ruby.

Why not just use Gosu?

Gosu does a lot of great work bringing OpenGL to Ruby. However, when you finish the initial tutorial you are left with a brittle game that is very resistant to changes or new features.

  • Metro provides the concept of a Scene which is the first abstraction you would likely build after completing the tutorial.

Developing your game in individual scenes will make it easier to logically layout your game.

  • Sane management of images, animations, fonts, songs, and samples through model properties.

Having to load and cache fonts and images in every one of your models is tedious. It is also is wasteful as several of the same fonts are being used all over the place.

Metro makes it simple to move an actor from one position to another position. So simple movements, fades, color changes, and really any property change over time is defined very simply.

Delete those huge if ... elsif ... else input checking structures for keyboard, gamepad, and mouse button presses (down,up, and held). Metro makes it easy to define them and an attach a course of action to take when the event happens.

Why not use Chingu or Gamebox?

Both Gamebox and Chingu are much more mature libraries with a larger set of features.

With Metro the focus is on a smaller set of features with an emphasis on an implementation that leads to joyful development. An emphasis has been applied to creating elegant solutions which have documentation and examples.

  • Active Reloading while building your scenes.

Adjustments to your game code while working on a scene will automatically reload your game code. The template game sets up a shortcut key (Ctrl+R) that allows you to explicitly reload the game and the current scene.

  • Scene Edit Support

All scenes can have their visual component layout re-adjusted through an edit mode. The edit mode layout works for all labels, images, and menus.

Why you shouldn't use Metro?

Metro has some the following limitations:

  • Limited to the gems defined within Metro

At this point in time you are not able to define and package additional dependencies with your game. This means if you are using a gem that is not already defined by Metro you will run into trouble when running it on alternate systems. This will likely be addressed in the future when more demand arises.

  • Difficult Deployment

For individuals to play your game, they will also have to install Metro. However, work is being made to bring some simple packaging to Metro games to make them stand-along executables.

Installation

$ gem install metro

Usage

Running a Game

By default metro will look for a file named 'metro' within the current working directory if no gamefilename has been provided.

$ metro GAMEFILENAME

Please take a look at the example game project that is being built alongside of 'metro'. It currently showcases all the current features available to the game.

$ git clone git://github.com/burtlo/starry-knight.git
$ cd starry-knight
$ metro

Creating a Game

Metro contains content generators to assist you.

Creating a Game can be done with a single command.

$ metro new GAMENAME

This should generate for you a starting game with a branding scene and a title scene. The game allows the player to start the game.

The game is missing the first scene of the game. This can be created with the scene generator:

$ metro generate scene first

This should generate a scene in the scenes directory. The scene file contains a lot of examples of how to draw, animate and have your scene listen to events.

Resources

Programming

Art

Sound

Books