T
Tim Mcd
Anyone interested in a Roguelike game written in Ruby/Ncurses project?
Email me/post here!
([email protected])
Email me/post here!
([email protected])
Email me/post here!
Matthew said:Interested in playing? Testing? Developing?
I've considered writing one at some point, but I've yet to make time
and figure out ncurses.
Tim said:Sorry: That would be interested in developing. I am novice-intermediate
when it comes to Ruby code, but I thought it would be fun to create a
Ruby roguelike.
Nit said:It would be fun, certainly. Recently, i wrote my first ncurses program,
a snakes game and it was great fun. Since then, I am working on a much
larger ncurses project - would have loved to work with you.
ncurses is pretty easy and fun - one problem i occasionally face is
getting the refreshes correct - otherwise its cool. Remember to wrap
your windows in panels, and its better not to use stdscr if you intend
having multiple pages/windows/levels - use panels.
1. The only documentation on ncurses-ruby is the README file the authorTim said:Yeah, it's tough finding proper ruby documentation on Ncurses. I've just
been using the Ncurses book linked at the ruby-ncurses site. That is
written for C coding tho, so it's a bit hard porting it over. Panels?
Enlighten me please!
Interested in playing? Testing? Developing?
I've considered writing one at some point, but I've yet to make time and
figure out ncurses.
Michael said:http://github.com/manveru/ver
esp:
http://github.com/manveru/ver/tree/master/lib/ver/keyboard.rb
http://github.com/manveru/ver/tree/master/lib/ver/window.rb
http://github.com/manveru/ver/tree/master/lib/ver/ncurses.rb
I wrote a rougelike in ruby+ncurses, but the source isn't online
anymore, i can send you if you like
^ manveru
Thanks manveru - could you tell me what keyboard.rb does in a nutshell.
I simply bind keys using the "?\C-a" kind of notation to symbols or
procs.
I read your comment in window.rb of the bug that doesnt let you subclass
window. I had a long discussion on this here, i was trying to subclass
Form, iirc. Finally, someone said that the constructor was "shadowed",
so one cannot make another one (I cannot recall the exact words), or
maybe it was private. So i too had wrapped and delegated like you have.
I am interested in doing key mappings like Vi and emacs. Did lookMichael said:http://github.com/manveru/ver/tree/master/lib/ver/keymap.rb
but that's a lot more complicated, building a tree structure and
descends down into it until a matching keybinding is found. that
allows emacs-like keybindings like [C-x C-c].
There's one downside to ncurses in Ruby - they do not supportAnyone interested in a Roguelike game written in Ruby/Ncurses project?
Email me/post here!
([email protected])
Michal said:There's one downside to ncurses in Ruby - they do not support
multibyte characters. So your internationalization possibilities are
limited, and so are things like PC names.
Thanks
Michal
Has anyone here used or played about with "slang" / s-lang. Would that
be better in this respect? I don't believe anyone has written a ruby
binding.
What is the work involved to get ncurses-ruby MB enabled ? Is the
problem at the ruby end, or the ncurses end or the binding ?
It's at the Ruby end. 1.8 does not work with locale but ncurses seems
to use locale to determine encoding. Also ruby does not use ncursesw
when they are available.
1.9 could work but the extension would probably have to be updated to
at least link against ncursesw - at least that is how it worked for
me.
Haah! I read that today and was wondering myself. But i am not clear onMichael said:Could we use the new Ruby FFI to spare us the C mess?
Haah! I read that today and was wondering myself. But i am not clear on
how to link to .so or .a files. The example of getpid seems a little
"magical" to me (*still* a newbie)
Not to go offtopic, but does it mean we can load ncurse.so and then fire
away.
--
Sean said:Yes - the FFI interface is really easy to use. You just need to
specify which lib you are referencing with the #ffi_lib method.
require 'rubygems'
require 'ffi'
module NCursesFFI
extend FFI::Library
NameError: uninitialized constant FFI:latform::ARCH_
Nit said:Or maybe it does not work on OS X yet.
Seem to be other dependencies other than the gem (which installed fine).
Does it expect Jruby or rubinius ? I get:
Or maybe it does not work on OS X yet.
--
Michael said:It allows me to make any object the receiver of keystrokes, simply by
doing
Keyboard.focus = something
the object has to respond to the #key method and take the name of the
key (as string) as argument.
So, in my code, once i show or hide a window/pane/view that is
interactive, i simply let it take over the focus of Keyboard and don't
have separate dispatching or some kind of main loop.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.