Jump to content
  • Advertisement
Sign in to follow this  
Khainevis

2D tile maps using C++ and DirectX

This topic is 2503 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

Got my tile maps loaded using a multi-dimensional array. Now I am trying to figure out how to add values to the tiles for use in collision detection. If anyone could point me in the right direction/give me a code snippet that may help, I would appreciate it.

Share this post


Link to post
Share on other sites
Advertisement
You tilemap array just points to different index in your tilesheet. So when you do collision you take the index from the array and grab the tile it represent in your tilesheet. What you can is create TileProperty structure and put all the properties an tile can have in there. Then your tile index in your array can reference an TileProperty which contains teh information about the particular tile you are colliding with. A similar routine can be used to draw your maps as well. I hope that helps

Share this post


Link to post
Share on other sites
BornToCode is wright. DO NOT TRY TO REFERENCE the entire collision system or whatever esle you have BY THE DIRECT SCENE X,Y VALUES, IT WILL BE MESS WITH NO END

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!