Hello,
First time post, so far all my answers have been answered simply by going through the forums. My challenge is with manipulating 3D arrays.
I have a 3D array that is 50 in width, 1 high, and 3 depth. I am using this to store randomly generated coordinates before the layout has loaded. I am doing this to create an object without ever creating another object over top of one that has already been occupied when the layout gets generated using the array.
My current array setup:
-Depth 1 = "X" coordinate, -Depth 2= "Y" coordinate and "Z" stores the same value (for example "sprite1").
My dilemma:
I would like to loop through the entire array named "arrayMap" and remove all duplicates where index "x" depth 1 and depth 2 are duplicated.
For example:
Index 4, Depth 1 = 20, Depth 2 = 15, Depth 3 = "sprite1"
Index 32, Depth 1 = 20, Depth 2 = 15, Depth 3 = "sprite1"
Index 4 and Index 32 have the same values stored for an "X" and "Y" coordinate so I would like to remove the duplicate (while of course keeping one instance of it).
Hopefully my explanation makes sense. I did a lot of reading on arrays but my feeble brain gets lost as soon as nested loops and 3D arrays get involved.
I appreciate any help that can be offered as this will solve a ton of my "random generated" sprite issues that I currently have, not to mention make things a lot cleaner with less coding.
Cheers.