Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: My first finished Java project (A text game)

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default My first finished Java project (A text game)

    Hello!

    I started programming Java last December and have been working on a text-based roleplaying game (Like a MUD, except it's single player) since around May.

    Today I finished what I will consider the final version for this project, so I figured I'd share it with you guys.

    I didn't start out with any grand design and I was learning as I went with this project, so there are probably a lot of places in the code you will think "Why the hell did he do like that?". But I've learned a lot of things from this, especially when it comes to object orientation, so that's completely fine by me. Now I can truly see how important it is to make a proper design from the very beginning, as it's complicated things later on in this project. For example, I had to remake my entire Character class in order to serialize it to be able to save the game, which makes the code look a whole lot more messy than before. If I had designed the game with saving in mind from the start, it would've been much less painful.

    Now to the game.

    It's basically your average text game with commands that will take you between rooms, kill NPCs, talk to NPCs, interact with objects and use items from your inventory etc. It also comes with a handy ingame compass that shows the exits of every room in a very easy to understand way. You can become stronger by fighting things and doing quests and there is a main story to follow. Also it's wrapped in a GUI console which enabled me to launch the game directly without having to go through the Windows console or a bat-file. This GUI console also makes it possible to use colored text, though it's not used much. Estimated play time is ~3-5 hours.

    You can download the game itself here: http://robinsuu.com/uploads/legend1.2.rar (Contains an executable for Windows and some help files)

    And the source code here: http://robinsuu.com/uploads/legend1.2_source.rar

    I also included maps in the game pack that I created with an online tool for roleplaying mapping.

    I'd love to hear some feedback about the source code and/or the game itself.
    Last edited by robinsuu; August 7th, 2014 at 04:18 PM.


  2. #2
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: My first finished Java project (A text game)

    I managed to get it to work first time - great game by the way!

    Considering you have only been learning Java under a year that's an amazing
    accomplishment You source code is good, I like the extensive use of comments
    so people know what each part does. Also - thank you for not shoving loads of
    code in method main

    More experienced members here will probably be able to give you tips on the code
    and extra praise etc, but well done - and keep up the good work.

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  3. The Following User Says Thank You to Ada Lovelace For This Useful Post:

    robinsuu (August 9th, 2014)

  4. #3
    Junior Member
    Join Date
    Jan 2014
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: My first finished Java project (A text game)

    Hey,

    I'm glad you liked it! Thanks for your words

    I try my hardest to make the code look as clean and readable as possible since I personally suffer from the memory of a goldfish

    I've generally been following the coding format used in the book Java Software Solutions - Foundations of Program Design (Pearson). I've tried two other books before that one, but this one really felt the most professional and narrows down things into manageable pieces. Meaning they don't try to teach every possible use of every method, but rather focus on the most important ones, because hey, the rest can all be found online I can really recommend that book for anyone trying to get into Java programming, especially since it has so much focus on clean and readable code, as well as object orientation. I would also advise to not skip the exercises. They might be boring, but they force you to do things and learn things you otherwise might put off.

Similar Threads

  1. Java programmer(s) wanted for commercial game project
    By JamesLit in forum Paid Java Projects
    Replies: 0
    Last Post: January 26th, 2013, 08:05 PM
  2. Replies: 1
    Last Post: December 4th, 2012, 07:16 AM
  3. Final Project - Trivia Game
    By Goforit in forum Java Theory & Questions
    Replies: 5
    Last Post: May 14th, 2011, 05:56 AM
  4. help on war card game project
    By sc0field1 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 3rd, 2011, 04:51 AM
  5. Programmer for a Java based game project
    By Takkun in forum Project Collaboration
    Replies: 4
    Last Post: June 14th, 2010, 05:47 PM