Sign in to follow this  
asdqwe

[C++] beginner's map editor

Recommended Posts

I have already tried the simplest 2 map editors available- random positions :), and reading entities' positions from a text file. Now I need something with a little more power than a Notepad file- I've heard many early 2D games used a bitmap from which they read only the pixels which had a certain color, that used to represent objects' positions. Could someone provide me with some code that does that; or even some advice? NB: please keep it all standard GDI stuff; the least amount of user-created libs, the better. Thanks!

Share this post


Link to post
Share on other sites
For the moment, MS Paint is my map editor: I draw some white dots on a black background, save as BMP, then attempt to make my game read all the pixels in that bitmap- when it comes across a white pixel, it stores its coordinates.
The difficult part is reading all the pixel colors in the BMP- how do I do that?

Share this post


Link to post
Share on other sites
Hidden
How about using a tile map? While you can use pixel-perfect collision detection the way you described (by using a black/white collision layer), it is in my opinion a lot more easier to use tiles and program a map editor to place tiles and save as levels.

I always recommend this tutorial, which is the one I learned how to program from: http://www.tonypa.pri.ee/tbw/start.html

It's for Flash, but I'm programming in C and the examples can be read as pseudo-code very easily.

Share this post


Link to post
For tilemap editing, I recoommend trying Mappy

It is very easy to use, and can create nice and flexable tilemaps. And, its free.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this