Java-Gaming.org Hi !
 Featured games (90) games approved by the League of Dukes Games in Showcase (683) Games in Android Showcase (196) games submitted by our members Games in WIP (751) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 Isometric Grid - Tiles as objects  (Read 2072 times) 0 Members and 1 Guest are viewing this topic.
jh62

Senior Newbie

 « Posted 2013-05-30 05:43:01 »

Hi!

I'm trying to learn about Isometric projection and so far I understand the concept, but the mathematics I saw are a little confusing. Seems like everybody has it's own way of doing them: some are complex, some are simple...

I came up with my own way of drawing into a isometric grid, but the real challenge is mapping the mouse coords to the individual cells in the grid.

I never saw this done (don't know why), but I made every tile on my grid an object with a polygon surrounding it's boundaries and I think is pretty simple and straightforward, because I only need to check if mouseX & mouseY are inside them.

Don't know about a full game using this method, but so far it's fast and reliable.

I'm still trying to learn the "usual" way to do it, anyway...

hellrazer21

Junior Devvie

 « Reply #1 - Posted 2013-05-30 06:04:43 »

well i know one way of doing it is to use libgdx

if your making it from scratch i cant help much with that

actual

JGO Coder

Medals: 25

 « Reply #2 - Posted 2013-05-30 06:05:54 »

Quote
... I think is pretty simple and straightforward...

Making each tile an instance of a class makes sense and it looks like you have a reasonable and workable solution so I would stick with what you have unless some issue (performance, complexity, etc) forces you to change.

If you are still wondering if you have the right approach, it is worth thinking through a couple of scenarios that you plan for your game to see how well your current set up will handle it.
1. Will the player be able to rotate the board as a whole and/or zoom in and out? If so, do you think your current set up will be able to handle it?
2. When you have things on the tiles (units, buildings, whatever), will your setup be able to handle that. For instance, if the top of a building overlaps with a title and the player hovers over it, will your setup be able to detect that?

As an aside, I like the idea of the volume of the tile being highlighted as you hover over it (maybe as a colored translucent cube borderless cube).
jh62

Senior Newbie

 « Reply #3 - Posted 2013-05-30 06:10:29 »

As an aside, I like the idea of the volume of the tile being highlighted as you hover over it (maybe as a colored translucent cube borderless cube).

That's how X-COM: UFO Defense does it, hehe. Not my idea.

Thanks for the input. It's too early to tell what you asked, since I'm first trying to master everything I need to do for my game before actually doing it.

About the zoom: with AffineTransform i can easilly zoom in and out and everything keeps in place. I was messing around with it yesterday and it's awesome. I'll have to check it out with an actual game running.

I'll make a similar game as UFO Defense, just for the sake of practice. It's an awesome game.
jonjava
 « Reply #4 - Posted 2013-05-30 15:16:38 »

There's no "usual" way. There are just ways that work and don't work. What's key is how you separate logic, data and graphics. And two of those three have nothing to do with isometric projections at all.

jh62

Senior Newbie

 « Reply #5 - Posted 2013-05-31 04:44:49 »

There's no "usual" way. There are just ways that work and don't work. What's key is how you separate logic, data and graphics. And two of those three have nothing to do with isometric projections at all.

I just got curious because I didn't see this simpler approach done in the many tutorials I've seen on the internet.
Pages: [1]
 ignore  |  Print

You cannot reply to this message, because it is very, very old.

 orrenravid (227 views) 2016-07-16 03:57:23 theagentd (295 views) 2016-07-11 14:28:54 Hydroque (382 views) 2016-07-06 05:56:57 Hydroque (533 views) 2016-07-03 08:52:54 GrandCastle (403 views) 2016-07-01 09:13:47 GrandCastle (396 views) 2016-07-01 09:09:45 CopyableCougar4 (449 views) 2016-06-25 16:56:52 Hydroque (422 views) 2016-06-22 02:17:53 SwampChicken (387 views) 2016-06-20 13:22:57 SwampChicken (306 views) 2016-06-20 13:22:49
 Archive 30x Slyth2727 24x Brynn 23x EgonOlsen 22x orangepascal 22x TritonDreyja 21x orange451 20x DavidBVal 19x Spasi 18x Opiop 11x princec 11x LiquidNitrogen 11x Phased 11x Longor1996 10x ziozio 10x KaiHH 10x
 Making a Dynamic Plugin Systemby Hydroque2016-06-25 00:13:25Java Data structures2016-06-13 21:22:09Java Data structures2016-06-13 21:20:42FPS Camera Tutorialby Hydroque2016-05-22 05:40:58Website offering 3D Models specifically for games for freeby vusman2016-05-18 17:23:09Website offering 3D Models specifically for games for freeby vusman2016-05-09 08:50:56Website offering 3D Models specifically for games for freeby vusman2016-05-06 11:10:21Website offering 3D Models specifically for games for freeby vusman2016-04-29 12:56:17
 java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org