Jump to content
  • Advertisement
Sign in to follow this  
gamechampionx

Rogue Clone

This topic is 4975 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!