Game Tile Layout Help

Discussion in 'Java' started by andrew arthur, Jun 8, 2004.

  1. Hi guys,

    I'm starting my first Java game, and need some help with the graphics. It's
    going to be an RPG on a tile-based 2D map. Here's what I have so far:

    About 20 PNG files (50x50) // these will be the tiles
    A Tile class which extends JFrame and displays a PNG file
    A Map class which creates the map as an int[30][30] array // the value of
    the int determines what tile will be displayed

    I want the GUI to show only the 400x300 area surrounding the player.

    Question 1: Is JFrame the best way to represent a tile?
    Question 2: What's the best way to lay out the tiles?

    Cheers,

    Sean
    andrew arthur, Jun 8, 2004
    #1
    1. Advertising

  2. On Tue, 8 Jun 2004 17:09:43 +0100, andrew arthur wrote:

    Question 0: What's the best group for GUI questions?

    <http://www.physci.org/codes/javafaq.jsp#cljg>
    But not before reading the FAQ..
    <http://www.physci.org/guifaq.jsp>

    > Question 1: Is JFrame the best way to represent a tile?


    No. Not unless you need to have them
    floating free of each other.

    Usually it is best to make your top
    level component a Container or (J)Panel.

    That way you can put it in a JApplet,
    JFrame or JWindow as need be.

    > Question 2: What's the best way to lay out the tiles?


    GridLayout for the 30x30 array,
    possibly nested in a border layout
    with controls/readout etc. in
    NORTH, SOUTH, EAST, WEST.

    HTH

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, Jun 8, 2004
    #2
    1. Advertising

  3. On Tue, 08 Jun 2004 16:40:27 GMT, Andrew Thompson wrote:
    ....
    > Question 0: What's the best group for GUI questions?
    >
    > <http://www.physci.org/codes/javafaq.jsp#cljg>


    I see you have taken it up there..
    Andrew Thompson, Jun 8, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BlackHawke
    Replies:
    12
    Views:
    1,569
    Andrew Thompson
    Jan 26, 2004
  2. cbfk23
    Replies:
    1
    Views:
    455
    Andrew Thompson
    Oct 17, 2004
  3. Replies:
    0
    Views:
    445
  4. Replies:
    1
    Views:
    572
    John Timney \(MVP\)
    Jun 19, 2006
  5. judith
    Replies:
    0
    Views:
    1,651
    judith
    Nov 1, 2006
Loading...

Share This Page