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 2 of 2

Thread: Help needed for Game developing

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help needed for Game developing

    hey guys i have got an assignment of creating Boulder-Dash in java with 5 different levels...
    can anyone tell me how can i design levels using text file...

    I mean first i will create 5 text files and design my 5 different levels like this by writing some symbols or alphabet in the textfile.

    WWWWWWWWW
    WDDRDDDDDdDW
    WDDDDRDDDdDW
    WdDDdDDDRDDW
    WDDRDDdDDDDW
    WWWWWWWWW


    Where:

    W= Wall
    D= Dirt
    d= Diamond
    R=Rock


    i just want to know how can i read the text file to check the letters. so that if the letter is "W" than insert wall image or if the letter is "d" than insert Diamond.

    Can someone help me please.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Help needed for Game developing

    how can i read the text file to check the letters.
    The Scanner class has some easy to use methods you could use to read the lines of the text file into Strings.
    Then the String class has some methods you could use to get at the individuals characters in the String.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 4
    Last Post: May 7th, 2013, 07:31 AM
  2. Guessing game syntax help needed
    By sstaurus12 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 27th, 2013, 02:19 PM
  3. [SOLVED] Countdown type game help needed.
    By Acaul in forum What's Wrong With My Code?
    Replies: 20
    Last Post: December 14th, 2012, 10:55 AM
  4. Basic 2D Game Help Needed
    By Kez323 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: October 13th, 2012, 02:37 PM
  5. Replies: 0
    Last Post: May 24th, 2012, 01:21 PM