Click to See Complete Forum and Search --> : Getting started with Curses/Java?
IsaacKuo
10-15-2002, 11:56 AM
Getting started with Curses/Java?
I'm a veteran programmer, but I've never programmed Curses nor have I programmed Java (I'm familiar with C and a little C++).
What I want to do is scratchbuild a simple (open source) Roguelike game, hopefully to eventually be cross-platform and eventually multi-player. I know "Curses" is what I want to base the default interface on, for maximum compatibility with various consoles and terminals.
I want to program in Java because it's a good skill to learn and because it's a good "neutral" cross-platform language and because I may want to learn how to put this game into an applet or even a servlet (i.e. multiplayer).
Any pointers on how to get started?
Thanks!
TheLinuxDuck
10-15-2002, 12:42 PM
Here are some links for java tutorials:
http://java.sun.com/docs/books/tutorial/
http://www.ibiblio.org/javafaq/javatutorial.html
http://sepwww.stanford.edu/sep/josman/oop/oop1.htm
There's a few to get started and pick from.. just do a search in google or something for java tutorials and you'll get a nice listing.
Bruce Eckels Thinking in Java is a good place to get info, as well.
http://www.mindview.net/Books/TIJ/
And, the java API becomes a very handy reference guide:
http://java.sun.com/j2se/1.4/docs/api/index.html
Since you're familiar with C, the syntax will be a breeze.. it's just he memorization of methods and terminologies..
For me, the biggest hurdle was OOP (I came from a similar background, of mostly C, with a tiny bit of C++, and perl). I still think very linearly, but once I start a project, I can generally get my head in place after a bit. (=
Good luck, and I hope that you enjoy java!
Btw, I am curious as to why you don't just simply take advantage of the simple GUI stuff for java? Swing makes GUI easier, and will still be cross platform. That way, you're not depending on the console only.
I'm sure that there will be people here or elsewhere online that will help you get into the groove of java.
Here's another place to get some java info:
http://www.javaranch.com/
TLD
bwkaz
10-15-2002, 01:19 PM
There's a C ncurses tutorial at www.tldp.org -- if nothing else, it should get you up to speed on ncurses stuff, even if it is C-specific.
But I don't know if there are bindings for Java for ncurses... There are standard bindings for C++ and Ada95 in the ncurses package, but that doesn't help you much. Maybe someone else knows?
IsaacKuo
10-15-2002, 01:34 PM
Thanks for the links! I have no problem with syntax or OOP, and I'm already taking an Internet course on Java programming (my HR department offers training through Mindleaders).
But the course I'm taking is rather outdated and so far has only done the really boring stuff I could do in my sleep (syntax, data structures, algorithms, OOP). That's what my CS degree was for.
I really need help with the API stuff. What good is knowing how to implement a generic expandable game world simulation data structure if you don't even know how to move the cursor to an arbitrary point on the screen? Stdin and stdout are incredibly limiting for what I want to do.
Some of the tutorials you linked are extremely helpful for these basics--well, if I wanted to make an interactive graphical applet. And I find it very helpful, since that's also something I'm interested it at some point.
However, I really want to use Curses and text consoles/terminals. I want to run it in shell windows, which is already set to the user's favorite font/transparency/etc. I want to run it on machines with no graphics mode. I want to run it in telnet/ssh windows remotely. That's what I want, for now, for this project.
TheLinuxDuck
10-15-2002, 02:07 PM
I found this with a little bit of surfing.. it doesn't sound complete, but possibly a place to start?
http://www.nongnu.org/jcurzez/
And another:
http://sourceforge.net/projects/javacurses/
This looks like it has promise (I'd check this out first):
http://www.pitman.co.za/projects/charva/
Hopefully one of those will solve your problem.
the only other answer I have is to use ansi escape sequences. That would allow you to build a simple text-based interface.. but the biggest problem with that is that the IBM-compat user will have to load ansi.sys (unless their console supports it) before use.
Hope that helps!
TLD
IsaacKuo
10-15-2002, 03:25 PM
Wow, thanks! I guess I still don't really understand exactly what "curses" is or how to use it, but I think JCurzez may be what I'm looking for. I want to hit the display directly, without any screen clutter or bandwidth consumed by windowing.