Rogue Clone

Started by
1 comment, last by gamechampionx 19 years, 2 months ago
I'm a University student, doing first-year cs. I'm wondering if it would be terrible to write a Rogue clone as a java applet. The game seems easy enough to write. I have experience with OOP and inheritence, interfaces, and all that stuff. I've never done applets before though, but I know how to construct them. I'm wondering if anyone knows the ins and outs of displaying text, such as in rows and columns in an applet. Thanks a lot!
Check out Drunken Brawl at http://www.angelfire.com/games6/drunken_brawl!
Advertisement
Do you really have to write as an applet instead of a proper application? The text-based graphics are intended to take advantage of the simplicity of working with a console (and probably a console library such as 'ncurses' to do text positioning - I don't know if that's available for Java though). Once you're stuck creating your own window, it doesn't really save any effort vs. drawing actual graphics using tiles.

That said - I assume you have some background in the UI toolkit; look up the Graphics class, and particularly Graphics.drawString(). You will want to set a monospace Font for your display, create a window (or region) that is 80x25 (or whatever) characters according to that Font's metrics, and then create a Canvas representing that region, with a Graphics context that draws to it. Then update the display in the paint() method; the simplest thing would be to always paint over with a black rect, then set the colour back to white, and output all the "text" of the level (held in a byte[][], char[][] or String[]) row by row.
Awesome, that's exactly what I was looking for. Thanks man. I do have experience with interfaces, so it shouldn't be too much of a problem.
Check out Drunken Brawl at http://www.angelfire.com/games6/drunken_brawl!

This topic is closed to new replies.

Advertisement