Hello,
This is my first post on this forum and i introduce myself as a
java newbie. Over the past two years i have been creating a turn based java game on and off. Ive had many attempts, each attempt getting better. My last attempt i coded random map generation, units, terrain types, movement, battle system etc. However, my weakness is understanding of graphics in java, in particular , isometric graphics. I feel let down as i can code a decent amateur game, but can only display it "top-down".
Firstly, while i have been game programming, i have looked extensively at isometric graphics. I have found good information, such as in gamedev.net/amits webpage/various forums. I understand the concept of isometrics - it is basically a square grid rotated 45% to create the illusion of 3d. I believe this is done via a formula. Any code examples are for c++.
Please find below a very simple method to generate square terrain tiles. The way it works is as follows;
1- a reference array is created. This decides terrain type. In this example each has a movement cost and an icon.
2- a JLabel array that displays the icon of the terrain. Only one layer is used in this simple example.
3-each JLabel is a 64x64 square. Grid size is set at 2x2.
Note; the code has been typed out recently and i apologize for any "case" errors/unprofessional layout/any "}" left out at end of code etc. i think x/y may be mixed up too.
1: how do i make this isometric (i assume rotate 45 degrees)
2: if it is not possible to do this (due to square jlabels), how do i represent graphics via the reference array.
3: Any advice on "better coding" would be appreciated
4: Would it be possible to display both isometric and "top-down" with the same application. e.g. Main window = isometric/Pop-up window = topdown
Thankyou for reading the post and i hope you can help, either with code,advice,links etc.
Regards,
David
[ October 01, 2006: Message edited by: David Laverty ]