Results 1 to 4 of 4
  1. #1
    Clayden is offline Member
    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    Default How to program a map for a 2D game?

    I need help programming a game for my matric project, I would like to make a 2D map, which is used for characters to move on, how do I go about it? :)

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: How to program a map for a 2D game?

    This question is impossibly broad. My advice is to Google the different approaches to 2D maps (procedurally generated, tile based, etc.), choose the kind that best suits your project, write some code, and then ask specific questions about your code.
    Get in the habit of using standard Java naming conventions!

  3. #3
    Kkenjoy is offline Member
    Join Date
    Apr 2013
    Posts
    7
    Rep Power
    0

    Default Re: How to program a map for a 2D game?

    Well if i were you, i would think first of the concepts you want in your game.
    A good practice is to make a domain model before starting to code.
    For example... You want to make a game with a map. Think of a "map" with "squares" and represent them in code.

    Java Code:
    public class Map {
    
    ...
          private HashMap<Integer, LinkedList<Square>> map;
    ...
    }
    Where your Key would be the line of the map.

    To be honest i never did graphical game, but maybe this helps for the core of the game, and then when you finished the model you can add the rendering for the representation of the map.

  4. #4
    Mutt is offline Member
    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    Default Re: How to program a map for a 2D game?

    My personal preference is going for a tile based map, but this can change depending on what kind of game you are going to make.

Similar Threads

  1. Help with Program...Stone Game
    By VettesRus in forum New To Java
    Replies: 7
    Last Post: 06-12-2012, 05:55 PM
  2. Replies: 8
    Last Post: 07-12-2011, 02:32 PM
  3. trying to write a program for hangman word game
    By durdanto in forum New To Java
    Replies: 1
    Last Post: 02-12-2011, 03:53 AM
  4. Replies: 7
    Last Post: 07-21-2009, 03:39 AM
  5. Java Game Program
    By software_dude_2009 in forum New To Java
    Replies: 3
    Last Post: 02-22-2009, 05:31 PM

Posting Permissions

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