1 Replies - 81 Views - Last Post: 04 February 2012 - 05:45 PM Rate Topic: -----

Topic Sponsor:

#1 lp150189  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 04-February 12

Create a map in Java

Posted 04 February 2012 - 04:03 PM

Okay guys, I have a game I have to do that involve a map just like a chess map that I have to create.

I intend to do it in text based because my level of programming is very so- so.

You don't have to tell me the code. just tell me the ideas how to make it or how to find info to do it. I've google a lot but I still am very lost.

I just have no clue how to display the map and relate it with my character.

Thank you so much for your help

Is This A Good Question/Topic? 0
  • +

Replies To: Create a map in Java

#2 M4trixSh4d0w  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 32
  • Joined: 07-May 10

Re: Create a map in Java

Posted 04 February 2012 - 05:45 PM

You could have an array that stores levels, or load it in from a file. the level would consist of characters, and be loaded into an array
then your character could be like a '@' and the walls a '*'. then let the player input the direction they want to go (w = up, s = down, a = right, d = left)
and check if your character can move that way without hitting a wall or a trap and reprint it.

heres an example map:
*  *  *  *  *  *  *
* @  *  #         *
*      *  *  *     *
*     *  *   *     *
*                    *
*  *  *  *  *  *  *


'*' is the wall
'@' is your character
'#' is the end of the level
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1