A JRuby entity-component framework for game programming.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Welcome to the Ruby Entity-Component Framework

This framework (RECF for short) is designed to help game authors construct modern, high-performance games using the elegant Ruby language and a fairly new alternative to OOP called an "entity component system". An Entity Component System is a programming methodology that successfully addresses many shortcomings of OOP and streamlines game creation and maintenance.

The RECF has been documented in a series of blog posts by the author:

Entity-Component game programming using JRuby and libGDX

Are you using this in a game?

Won't you consider emailing the author at cpowell@prylis.com ? I'd love to hear how the framework is being used "in the wild".


The stock RECF utilizes libGDX (and LWJGL) to operate, although it has also been adapted to Slick2D. These are bundled with the RECF source and don't need to be separately downloaded.

But note: the entity component piece itself is wholly agnostic to the graphics / game engine (libGDX, Slick, whatever). You can easily adapt the RECF to your favorite graphics system: Unity, Torque 3D, ...

The RECF uses JRuby and has been tested with version 1.7. You'll need to install your own JRuby interpreter (with, say, RVM).

The RECF also uses some Gems which you can install with:

$ bundle

Running the sample game

The RECF includes a very basic "Lunar Lander"-type game that is intended to be used as an example and teaching tool for the framework. You can run the game with:

$ ./run.sh (*nix, MacOS)	
run.bat (Windows, requires jruby in your PATH)

(You'll need to have met the dependencies first.)

A, D => rotate, S => thrust

You can also generate a precompiled, distributable, multi-platform, jarfile package for your game as follows:

$ rake jar

...and run it:

$ java -jar ./recf.jar

Further reading about Entity-Component Frameworks

Entity Component systems are quite different from Object Oriented Programming, especially if you are already a seasoned OO programmer. These resources will help you learn the justifications and benefits of Entity Component systems versus OO:

  • In this article, Justin tidily articulates the typical problem that OO creates but EC fixes.
  • This T=Machine blog series offers a highly detailed and experienced look at the advantages to EC in MMO development.
  • "Evolve Your Hierarchy" is a commonly-referenced piece on OO vs. EC.
  • This wiki (by Adam of T=Machine) is one of the canonical EC references; you’ll return there often for advice.


A special "thanks" to Peter Cooper for writing Let’s Build a Simple Video Game with JRuby: A Tutorial. His article inspired me down this path.

Bitdeli Badge