Jump to content
  • Advertisement

Archived

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

Programmer16

A question about tile system design

This topic is 5306 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!