Jump to content
  • Advertisement

Archived

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

cpurp55

Placing Units on a Map

This topic is 5653 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 having problems placing all my units in one bitmap and getting them placed on the map. I don''t know how to create a bitmap that program can read as an array.

Share this post


Link to post
Share on other sites
Advertisement
If Doing normal GDI programming, look into DIBs (Device Independant Bitmaps) and CreateDIBSection() functions. I don''t know how well this will work with DirectX/SDL/OpenGL. I''m pretty sure you use DIBs for DirectX also, but don''t quote me on that.



Dino M. Gambone
Good judgement is gained through experience. Experience, however, is gained through bad judgement.

Share this post


Link to post
Share on other sites
Maybe I didn''t understand your questions correctly. Can you give us your exact problem?



Dino M. Gambone
Good judgement is gained through experience. Experience, however, is gained through bad judgement.

Share this post


Link to post
Share on other sites
You simply create a bitmap that is large enough to hold each of your units in the different frames of animation. Use something like photoshop to place them correctly. Then, you''ll either have to write your own functions to parse out the file into its different unit images or find a library that does it for you. There are several examples in the Prima Dev series. I think that the one called The Zen of Direct3D Game Programming has some halfway decent examples for a beginner for simple 2D stuff. Take a look at the code they use for the Zen console and you should be able to pretty easily modify it for use with your 2D graphics.

Share this post


Link to post
Share on other sites
Do you know any good websites that might have the librarys I would need to do the paarsing of the bitmaps.

Share this post


Link to post
Share on other sites
i''m getting a pretty good picture of the type of programmer you are, mr. cpurp55. you emailed me a while back asking about some of my code from chapter 18, and posted the same problem here.

however, it has become obvious that you did not bother to read chapters 1-17 first, because otherwise you would know that i provide in my book a CTileSet class that does much of what you want to do. also, there is more than enough information on GDI to be able to create bitmaps in my book.

do you just want us to write your game for you and email it to you when we''re done?

Share this post


Link to post
Share on other sites
For one thing my friend give me your book 4 days ago because he couldn''t figure it out. So i''m been giving myself a crash course so I''m sorry if I have some questions. Maybe it is not us who can''t figure it out and maybe it is the book. I have taught myself how to do MFC, ASP, PHP, and java. I can teach myself languages if I have a good refernce. I''m glad I didn''t spend money on a a book like this.

Share this post


Link to post
Share on other sites

  • 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!