Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


btatarov

Member Since 15 Mar 2013
Offline Last Active Apr 04 2013 12:14 PM

Posts I've Made

In Topic: Mahjong based tile perspective

30 March 2013 - 01:32 PM

I was finally able to solve it with ordering without any hacks. Here's how (if anyone needs it):

 

1. Get the tiles for each layer (z axis)

2. Get the ones that are free (the ones that do not intersect half way through with other tiles)

3. Sort the free ones right to left, top to bottom and insert them in an array with ordered ones

4. Remove the free ones from the array

5. Repeat step 2 until there are no tiles left.

6. Reverse the array with the ordered tiles.

 

Works like a charm.


In Topic: Mahjong based tile perspective

30 March 2013 - 08:52 AM

There are two problems with that solution:

1. There is an animation at the beginning that "draws" the level where tiles fly from all the corners of the screen.

2. I need to implement the same solution for the level editor. It may be a bit slow to re-render the entire scene every time new tile is moved/added but it gets the job done.


In Topic: Mahjong based tile perspective

30 March 2013 - 08:26 AM

I may be missing something really simple but given example 1 it will render A before B as its Y is lower. If I render top to bottom -> right to left everything looks okay except for situations like example 2.

 

example2z.png


In Topic: Mahjong based tile perspective

30 March 2013 - 08:08 AM

Yes, that was what I thought at first (rendering right to left, top to bottom) but in this particular case the left tile is rendered before the right because its Y is smaller (assuming I'm working with top-left orientation). Just to say that if the tile is at X = 5, Y = 6, then it's rendered at X = 5, Y = 6 and X = 5, Y = 7.


PARTNERS