• entries
78
138
• views
35842

# 2D Engine Map Editor

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

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++)
{
//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.

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,



## Create an account

Register a new account