• Advertisement

Archived

This topic is now archived and is closed to further replies.

A question about tile system design

This topic is 5066 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m making a tile system for my game and I''ve come up with a design that I think is really good and I was looking for some CC on it. I have my EgTile class which has the texture index (for use with the texture manager) and a RECT to store the left, top, right, and bottom. It also has 3 methods: Create, GetRect, and operator(). Then I have my EgTileManager class which has an array of EgTile, the tile count, and the current tile. It also has 3 methods: Create, AddTile, and operator(). Then I could just go through and have a EgTileManager for each map or whatnot and load the tiles:
EgTileManager TileMgr;
TileMgr.Create(FIRST_TOWN_MAP_TEXTURE, 0, 0, 256, 256);
//...

Then when I want to draw the tile I just call ID3DXSprite::Draw()
//Begin()

//g_Sprite->Draw(g_TextureMgr(TileMgr[CurrentTile].m_iTextureIndex), NULL, NULL, NULL, 0, 0xffffffff);

// End()

// Present(...)

Any CC would help. Thanks in advance! /* I use DirectX 9 and C++ (Microsoft Visual C++ 6.0 Professional edition) */

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement