# code for another forum

## Recommended Posts

zappernapper    186
because the board tags were screwing up my post on another forum, i've included my code posting here, if anyone wishes to comment on this, knock your socks off
[code]
void Map::Update()
{
for (int i = 0; i < m_iNumLayers; ++i)
for (int j = 0; j < m_iMapHeight; ++j)
for (int k = 0; k < m_iMapWidth; ++k)
m_pLayers[i][j][k]->Update();
}

void Map::Draw(HDC hDC)
{
for (int i = 0; i <= m_iNumLayers; i++)
for (int j = 0; j <= m_iMapHeight; ++j)
for (int k = 0; k <= m_iMapWidth; ++k)
if (m_pLayers[i][j][k] != NULL)
m_pLayers[i][j][k]->Draw(hDC,
m_pLayers[i][j][k]->GetWidth()*k, m_pLayers[i][j][k]->GetHeight()*j);
}

bool Map::AddLayer(BackgroundLayer* pLayer, int x, int y, int z)
{
if (x < 10 || y < 10 || z < 10)
{
m_pLayers[z][x][y] = pLayer;
m_iMapWidth = max(x, m_iMapWidth);
m_iMapHeight = max(y, m_iMapHeight);
if (x > y &&
sizeof(*pLayer) != sizeof(*m_pLayers[z][x][y+1])    )
m_pLayers[z][x][y+1] = NULL;
return true;
}
return false;
}

again Map is publicly derived from ScrollingBackground

##### Share on other sites
HellRiZZer    308
Erm, again, what are we supposed to comment on?

##### Share on other sites
Rhaal    754
Are you saying you wanted help on another forum, but couldn't post code there so you're posting it here and linking to it?

You're probably better off with a paste bin like: http://www.nomorepasting.com/

##### Share on other sites
zappernapper    186
yes, i was trying to post on a different forum and the boardtags were reacting weird to my source code paste. it all relates to a very specific game engine that poeple on that board would be familiar with. i'm trying to expand on the engine to work with smoothscrolling bigbitmap tiles. the scrolling algorithms are long (are there such things as short ones?) and to understand how everything works i would need to post a lot more code here than anyone i'm sure would be willing to read through

## Create an account

Register a new account

• 9
• 11
• 9
• 11
• 9