LSn145
10-04-2011, 08:00 PM
So let us say that I have an Array:
int maxSize = 9;
int arr[][][][] = new int[maxsize][maxSize][25][19]
This works great...
But I need to use negative values like:
chunkX = -1
chunkY = -1
arr[chunkX][chunkY][12][9] = 0
but the array doesn't work that way.
It's for a coordinate system that has to be able to have negative values in the chunkX/Y variables.
More on the array:
"maxSize" is the maximum chunks,
each chunk has 25*19 coordinates that includes a value ranging between 0 and maximum(where maximum is currently 1)
the chunk arr[0][0] is equal to two more arrays that contains the values between 0-1, and there are a total of 475 coordinates in each chunk that must be filled.
But the chunkX and chunkY must be able to go to minus...
It doesn't have to be an array...
Any help are much appreciated :)
int maxSize = 9;
int arr[][][][] = new int[maxsize][maxSize][25][19]
This works great...
But I need to use negative values like:
chunkX = -1
chunkY = -1
arr[chunkX][chunkY][12][9] = 0
but the array doesn't work that way.
It's for a coordinate system that has to be able to have negative values in the chunkX/Y variables.
More on the array:
"maxSize" is the maximum chunks,
each chunk has 25*19 coordinates that includes a value ranging between 0 and maximum(where maximum is currently 1)
the chunk arr[0][0] is equal to two more arrays that contains the values between 0-1, and there are a total of 475 coordinates in each chunk that must be filled.
But the chunkX and chunkY must be able to go to minus...
It doesn't have to be an array...
Any help are much appreciated :)