views:

155

answers:

5

I would like to build a simple standalone solitaire game in ruby. Are there any libraries I should use? Do I even need game libraries to have cards moved from one stack to another? I have never written any games, and I haven't built a standalone app for a long time, that's why I'm lost :)

A: 

I hear Shoes is easy to use for GUI development, but I don't have any personal experience with it. You could use it to draw up the game screen and move the cards around once they're clicked. Asides from that, I wouldn't think there's any libraries you would need unless you have a particular problem in mind.

Chris Bunch
+3  A: 

It seems you are rushing into the graphics part of your game. Have you thought, deeply, about your game logic? I'm also into game development and what I usually do before going into graphics is getting all the game logic implemented (or the most part of it) so I can test in the system console / command line. After I'm happy with it, I move on to graphics, sound, animation and other cool stuff

nairdaen
Thanks for the suggestion, I'll try making it work in the console first. It seems to me though that events are much easier to control in the console - or am I wrong?
squil
usually games are not driven by events but by an "infinite" loop in which you check the input (mostly keyboard, mouse, gamepad or even network), you react to your input and modify your game state. After modifying your game state, you show it in the screen
nairdaen
+2  A: 

I tend to agree with nairdaen about working on the domain logic first. But, if/when you want to work with graphics/sounds, I suggest Gosu as it has a very nice and simple API.

pschneider
A: 

As others are suggesting, start with game engine, which can be controlled entirely by console, and worry about GUI later.

Do I even need game libraries to have cards moved from one stack to another?

No, you can implement it as dynamic web application and use prototype javascript library for moving cards (as images) from one "heap" to another.

Lukas Stejskal
+1  A: 

I used Rubygame once to prototype collisions and visualize them. It's a good graphic library for 2d games.

For the "standalone" part of your question, it's a little bit tricky in Ruby because running a Ruby application requires the Ruby interpreter and all the libraries used by your application. Distributing your game can become cumbersome for the user. However, you can have a standalone Windows application (read: .exe) using RubyScript2Exe.

Jodi