Hi there,
My friend and I are making a game, which is based on a tile engine we are making. The map is loaded into an array of integers to represent each different tile. However, in the map class, we need the variable data
to hold the integer array so we can access it like this: MAP level1; x = level1.data[0][0];
. The problem is that we can't make the int array until we know the size (no vector replies please). The size is stored in level1.size
during the function MAP::Load()
. Can we do one of the following:
- Initialize
data
in theMAP::Load()
function, BUT have it public, so it can be accessed from outside usinglevel1.data[0][0]
for example. - Initialize
data
in the public section of theMAP
class, then make the functionMAP::Load()
return the 2D int array to it. - Do something else without vectors to the same effect.