Java-Gaming.org Hi !
 Featured games (84) games approved by the League of Dukes Games in Showcase (563) Games in Android Showcase (151) games submitted by our members Games in WIP (604) 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 1380 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: 24

 « 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.

 wxwsk8er (48 views) 2015-03-20 15:39:46 Fairy Tailz (42 views) 2015-03-15 21:52:20 Olo (26 views) 2015-03-13 17:51:59 Olo (27 views) 2015-03-13 17:50:51 Olo (33 views) 2015-03-13 17:50:16 Olo (40 views) 2015-03-13 17:47:07 ClaasJG (29 views) 2015-03-10 11:36:42 ClaasJG (36 views) 2015-03-10 11:33:01 Pippogeek (45 views) 2015-03-05 14:36:23 Pippogeek (37 views) 2015-03-05 13:56:12
 KevinWorkman 23x LiquidNitrogen 23x BurntPizza 22x basil_ 21x Riven 20x theagentd 19x EgonOlsen 17x Roquen 14x princec 12x Slyth2727 9x NegativeZero 9x Ecumene 9x SHC 9x Varkas 9x ClaasJG 7x teletubo 7x
 How to: JGO Wikiby Mac702015-02-17 20:56:162D Dynamic Lighting2015-01-01 20:25:42How do I start Java Game Development?by gouessej2014-12-27 19:41:21Resources for WIP gamesby kpars2014-12-18 10:26:14Understanding relations between setOrigin, setScale and setPosition in libGdx2014-10-09 22:35:00Definite guide to supporting multiple device resolutions on Android (2014)2014-10-02 22:36:02List of Learning Resources2014-08-16 10:40:00List of Learning Resources2014-08-05 19:33:27
 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