Today, I have a general question about storing objects/structs or some other values in a multidimensional array.
The actual scenario is as follows, but I might need similar solutions in many other places, which is why I want to ask you about the best-practice to this.
Suppose we have a side scrolling game. Now I need to store information about the cells of the world in some kind of 2-dimensional array, where 0:0 would be the home-position. At the beginning of the game, I generate a small area of the world, say from -10:-5 to 10:5. The player could move left or right (and sometimes up and down), so I have to generate more world information when he reaches the edges of the world. Now my question: How am I supposed to store a 2-dimensional array with varying extremes? Are there any best practices around how to do this? What would you do?
Thanks again for all your help!
vector<vector<T> >.size_torintor whatever. Andvectorknows its size.vector<t>(dimension1*dimension2*dimension3*dimension4...), actually.