Results 1 to 9 of 9
  1. #1
    PhQ's Avatar
    PhQ
    PhQ is offline Senior Member
    Join Date
    Mar 2010
    Location
    Lithuania
    Posts
    358
    Rep Power
    5

    Default Best way to make maps

    What is the best way to make maps for games?
    Right now I am using a text file to store tile ID's and their X & Y coordinates.
    But I am sure there is a better way of doing it.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,390
    Rep Power
    25

    Default Re: Best way to make maps

    Are you talking about 2 dimensional representation of the features of some surface area?
    vs the Java SE Map class.

  3. #3
    PhQ's Avatar
    PhQ
    PhQ is offline Senior Member
    Join Date
    Mar 2010
    Location
    Lithuania
    Posts
    358
    Rep Power
    5

    Default Re: Best way to make maps

    I need to make a map for a 2D game.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,390
    Rep Power
    25

    Default Re: Best way to make maps

    Can you define what a map is and how it is used in a program?
    If the map is 800x600 pixels, do you need values for all those pixels?

  5. #5
    PhQ's Avatar
    PhQ
    PhQ is offline Senior Member
    Join Date
    Mar 2010
    Location
    Lithuania
    Posts
    358
    Rep Power
    5

    Default Re: Best way to make maps

    Quote Originally Posted by Norm View Post
    Can you define what a map is and how it is used in a program?
    If the map is 800x600 pixels, do you need values for all those pixels?
    Right now I have a text file which contains these values:
    Java Code:
    1	800	400
    1	750	300
    1	700	250
    The first number is the tile ID, the second number is the X coordinates and the third number is the Y coordinates.
    Then I put the data into an array and I go through each item of the array and draw the item on the screen.
    For example :
    Java Code:
    g.drawImage(grass, 50-mapOffsetX+tiles.get(i).x, 50 - mapOffsetY+tiles.get(i).y, null);

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,390
    Rep Power
    25

    Default Re: Best way to make maps

    I'm sure there are many ways to build a map. Wouldn't it depend on what the program needs to be able to recognize the features of the map?

  7. #7
    PhQ's Avatar
    PhQ
    PhQ is offline Senior Member
    Join Date
    Mar 2010
    Location
    Lithuania
    Posts
    358
    Rep Power
    5

    Default Re: Best way to make maps

    Quote Originally Posted by Norm View Post
    I'm sure there are many ways to build a map. Wouldn't it depend on what the program needs to be able to recognize the features of the map?
    Yes.
    I check what tile ID is at the player's position.
    Last edited by PhQ; 11-23-2011 at 11:57 PM.

  8. #8
    PhQ's Avatar
    PhQ
    PhQ is offline Senior Member
    Join Date
    Mar 2010
    Location
    Lithuania
    Posts
    358
    Rep Power
    5

    Default Re: Best way to make maps

    I have found a map maker which exports the maps into .dat, .lua and .wlk files.
    But I have no idea how to decode any of these files.

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,390
    Rep Power
    25

    Default Re: Best way to make maps

    What is the definition of a map? You need that before you can use one. Any program could have its own way of defining a map.
    I would think that a map must have a number of connected x,y pixel locations that define shapes or boundaries.

Similar Threads

  1. maps
    By aizen92 in forum New To Java
    Replies: 8
    Last Post: 05-24-2011, 09:53 AM
  2. Help with Maps
    By snripa in forum New To Java
    Replies: 4
    Last Post: 12-14-2010, 09:27 AM
  3. Maps and Sets
    By RedKMan in forum New To Java
    Replies: 3
    Last Post: 02-16-2010, 09:36 AM
  4. Maps
    By natep67 in forum New To Java
    Replies: 8
    Last Post: 05-06-2009, 03:59 AM
  5. Google Maps API
    By mew in forum New To Java
    Replies: 0
    Last Post: 12-26-2007, 10:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •