I've been working on a framework for Ruby/Gosu for a couple of months now.
After ~10 game prototypes in both Rubygame and Gosu and some small full games I noticed what I constantly repeated in my projects.
Then I decided to start build some reusable base code. Chingu is the result of that history + 4 different games being developed and common patterns abstracted out.
The core of Chingu:
- Pretty input-handling: @player.input = { :left => :go_left, :right => :go_right, :space => :fire } (main window and game states can also have input)
- Deployment safe asset handling: Image["player.png"] Sound["woff.wav"].play etc
- A stack based (push/pop), robust game state system
- Automatic tracking, drawing and updating of game objects if you use Enemy.create (instead of Enemy.new. Enemy is inherited from Chingu::GameObject)
- Base classes (BasicGameObject, GameObject) which will provide the most common functionality for 2D game objects
- Traits - simple but effective way of extending your game classes to provide physics, effects, timers and basic collision-detection etc
- Useful helper classes like: Animation, Parallax, Text and Rect
I know nobody will even look at a framework if it's not documented so I've taken some time to do just that:
RDocs:
http://rdoc.info/projects/ippa/chinguBig readme:
http://github.com/ippa/chinguI've bundled ~11 commented examples with Chingu since I myself love learning from examples. Examples show off game states, input-handling, the parallax-class, traits like collision_detect and velocity, particles and more.
There's 1 full game finished in Chingu so far: The Eternally Grey. See
http://www.libgosu.org/cgi-bin/mwf/topic_show.pl?tid=242 for more info.
It's a 48-compo game so it's not the best code ever :P. But it's decent and it depends on Chingu.
I got 4 more (very different) games in the works which I hope to be able to release during the coming months.
They're deliberately very different so I would force myself to constantly thinking in very abstract terms and not build any kind of game logic into Chingu.
During the development I've gotten feedback and input from the #gosu irc channel: Banisterfiend, shawn24, jlrn of course, jduff, apillet and others.
It's being developed in Ruby 1.9.1 so that's the preferred version. Both for Chingu-compatibility and, of course, speed. 1.8.7+ should work as well, 1.8.6 will have some problems.
Install
====
gem install chingu