Hello folks! Looking for a little technical advice - let me
explain:
I'm converting a small flash game that I had built in flash 8
with as2 to flash 9 with as3 and have hit a snag. The visible
object on the stage in that application is simialr to a rubiks cube
as seen from an upper corner (sort of an isometric view). There are
mutliple rows and columns and levels...lets just say it's a 3x3x3
cube. Through gameplay various cubes are moved around, added and
removed from the grid, sometimes a slot is empty sometimes full. In
order to track this and make sure that the cubes stay at the proper
depth relative to each other I had assigned each slot in the full
grid a grid number incremented by 10's for rowsand 100's for layers
and stored the numbers in an array. Then when I added a cube to the
stage I just looked up its depth value from the array, attached it
and appended its number to it's instance name and set it's depth to
the same number . Nothing ever got at an improper depth becuase
every slot had a fixed absolute number that could be pulled from
the array. My problem is that the new depth manager won't allow
gaps - each depth needs to be used before the next one can be used,
and that when you insert someting at an occupied depth everything
above it is pushed up by one so I can't track any of my cubes depth
as I had been becuase they keep changing.
Example: I'm my old system if I needed to move the first row
of cubes from the 3rd layer (cubes 310, 320, 330) straight down
into the second layer I would simply move them then swapdepth to
210, 220, 230. In the new system since i cant reserve a depth for
an empty slot I never know what number to move the cube to without
a convoluted lookup process, and once I do move it...every single
depth after it gets altered (which seems like a lot of extra work
for the system by the way)
So...anyone know a better way to manage depths of a 3
dimensional grid in as3?