'Gets the (2D) virtual X-coordinate from a single dimension array, given the index and desired row size (max x-axis value)
Sub getArray2D_X(Index As Int, RowSize As Int) As Int
Return index Mod rowSize
End Sub
'Gets the (2D) virtual Y-coordinate from a single dimension array, given the index and desired row size (max x-axis value)
Sub getArray2D_Y(Index As Int, RowSize As Int) As Int
Return Index / RowSize
End Sub
'Gets the Index based of the array's virtual (2D) X, Y and row size (max x-axis value)
Sub getArray2D_Index(X As Int, Y As Int, RowSize As Int) As Int
Return (Y * RowSize) + X
End Sub