Computer Science Canada C# arrayoutofbounds |
Author: | Tubs [ Sat Sep 13, 2008 3:11 pm ] | ||
Post subject: | C# arrayoutofbounds | ||
I am trying to initialize an array of colours to handle collision detection in an artillery game. The logic of this code is: - initialize a 1D array and a 2D to the size of the target map texture, in this case [960, 590] and [960*590] - Read the color data from the texture into the 1D array - Transform the 1D array into a 2D array - Scale the 2D array to twice the size Everything looks right to me but the compiler is throwing an ArrayOutOfBounds exception on every single line of the scaling algorithm inside the second nested for loop and I have no idea why. Any help is greatly appreciated.
|
Author: | Stove [ Sun Sep 21, 2008 8:47 pm ] |
Post subject: | Re: C# arrayoutofbounds |
Is the exception thrown when it first enters the 2nd nested loop? or after it starts iterating through it? |