Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

microbe-devel

Member Since 10 Oct 2012
Offline Last Active Oct 31 2012 07:28 AM
-----

Posts I've Made

In Topic: Dynamic allocation, 3d array, RPG-type level structure

13 October 2012 - 03:17 PM

That's sounds good !
I'm gonna put each tile in "one line" so i think this would work:
( x * y ) + ( 4* (x*y-1) ) + Z
Where x is tile x position, y is y tile position, and z is the row i want to get from the tile !
I will try, thanks !!!

Edit: my calcul was bad :rolleyes:
This work;

((y * (MapWidth - 1) + y + x) * 4) +Z

Where x, y are the tile coordinates ( first tile is 0,0 )
MapWidth is the map number of tiles in width
4 is because one tile contain 4 rows
Z is added to get the rows we want ( 4 rows, 0 -> 3 )

Thanks again !

PARTNERS