Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Game Tile Layout Help

Reply
Thread Tools

Game Tile Layout Help

 
 
andrew arthur
Guest
Posts: n/a
 
      06-08-2004
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


 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      06-08-2004
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
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      06-08-2004
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..
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help with card game game of war in GUI enviroment judith Java 0 11-01-2006 06:11 AM
Choosing Layout: Css-Layout or Table-Layout hpourfard@gmail.com ASP .Net 1 06-19-2006 10:06 AM
Help With A Tile Map crazyphill@gmail.com Java 0 03-21-2005 06:01 AM
Help: How to hide part of the tile on a window title bar? cbfk23 Java 1 10-17-2004 11:34 AM
DataList inside a Grid Layout Panel (<DIV>) item layout problem Rick Spiewak ASP .Net 3 08-26-2003 04:22 AM



Advertisments