Getting an object from a 2d array inside of a class
- by user36324
I am have a class file that contains two classes, platform and platforms. platform holds the single platform information, and platforms has an 2d array of platforms. Im trying to render all of them in a for loop but it is not working. If you could kindly help me i would greatly appreciate.
void Platforms::setUp()
{
for(int x = 0; x < tilesW; x++){
for(int y = 0; y < tilesH; y++){
Platform tempPlat(x,y,true,renderer,filename,tileSize/scaleW,tileSize/scaleH);
platArray[x][y] = tempPlat;
}
}
}
void Platforms::show()
{
for(int x = 0; x < tilesW; x++){
for(int y = 0; y < tilesH; y++){
platArray[x][y].show(renderer,scaleW,scaleH);
}
}
}