Temple of The Roguelike Forums
Game Discussion => Early Dev => Topic started by: kipar on March 19, 2011, 12:19:37 PM
-
The best way of learning a new language is to write a game in it. So it's my first attempt to create something in Ruby and my first attempt to use Curses library.
I've used algorithms from roguebasin page about ruby (permissive FOV and Bresenham). At first I've used recommended at roguebasin library NCurses, but there is no compiled version of this module for ruby 1.9, so i migrated to standard curses module (sadly it doesn't support some keypresses (arrows and numpad without Numlock)).
The link is
http://www.mediafire.com/?19q577h9flfkzbf
You need a Ruby (www.ruby-lang.org) to run it though. I have only tried it in Windows, but it should works in linux too (at least i hope so).
-
Downloading Ruby. Let's give this a shot =)
-
Man, I've downloaded Ruby, and ran your game, but my laptop has no keypad =< I'll have to try it on my desktop.
They look nice, though =D Both your game and Ruby.
-
Doesn't work on linux (and won't work on mac either probably) because you've used ".\" to specify filepaths. I think the cross-platform way is to use the unix "./", but I'm not sure.
Anyway I edited them all myself. Looks good so far. Two things that would make it a lot more playable would be to display all the keybindings when "?" is pressed, and to have Enter confirm a target for Missles *AND* Lasers.
I dunno if it's worth mentioning but it's quite slow on my (decade old) machine. Ruby is very nice but also very slow - thankfully extending it with C is relatively easy (I added a bit about that to ruby page on roguebasin)
-
Mech Combat was kipar's side project, to test Ruby and so on. I don't know would he continue development.
-
Well, under Ruby 1.9 it will be slightly faster than under Ruby 1.8. But there will be more problems with compatibility (require".\zzz" sholud be replaced with require_relative "zzz"). I'll post updated version tomorrow.
I've found a lot of problems (performance and compatibility) when using curses under ruby so perhaps in my next ruby roguelike I'll use pascal code for gui and use Ruby only for the game logic.
BTW, there are Ruby bindings for FreePascal (for fans of pascal): https://github.com/shikhalev/ppruby
-
I ran it under 1.9, but like I said I am on some seriously ancient hardware.
I am currently attempting an RL in ruby myself, though it makes use of a C "engine" I am concurrently writing. I feel this is a pretty good combination, and it's blazing fast.