Sign in to follow this  
  • entries
    78
  • comments
    138
  • views
    35516

2D Engine Map Editor

Sign in to follow this  

89 views

So I've chosen to go with the map editor first. I know for a fact this is going to be the hardest thing for me to do because I've always struggled with making anything map wise when I tried in the past. I have no problem setting up any maze with graphics in collision, however I'm not sure on how I'm going setup the map editor to save the files and what I'm really going to be doing. I've brought up a big stack of papers from downstairs to get deigning on. In the past, anything I couldn't do was because of poor design ideas and having no real objective but on the spot programming. When I started C++ programming I started deigning what I wanted either on my tablet in Photoshop or on paper, every thing works out much better this way because of that sense of direction.

I know there are a lot of map editors out there, however I became a programmer to create. Learning to make this map editor will allow me to expand my knowledge of programming. Now that my coffee is ready, time to get to work!
Sign in to follow this  


2 Comments


Recommended Comments

Anyway, why not save it as a .txt file for now?

Just define the types, ex: WATER_ONE = 1, RED = 2 , CAR_TYPE_ONE = 3 so on, and when it saves you'l have a nice file with row after row of numbers and all that is left is too make a loader that reades each uumber at a time and loades the file that goes with it.



for (i = 0, i <= map_height, i++)
{
for (j = 0, j <= map_width, j++)
{
//Here you should have it read your map and
//print the type number to the file
//Then later just create a loader using the same method
//but instead of writing too a file it will read from it
}
}






Im just a noob right now in c++ so there might be a better and more efficent way too do it but thats one idea.

Share this comment


Link to comment
Hey again.

I'm using this way:


BITMAP *Tiles[2];

int MapOne[15][20] = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 0, 0, 0,
  • Share this comment


    Link to comment

    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